mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-23 10:35:35 -04:00
a8559bfbbc
* Update all CMakeLists of extensions to use clang-format * Run clang-format on all Extensions * Update GDCore CMakeLists.txt to add clang-format * Run clang-format on GDCore files * Update GDJS and GDCpp CMakeLists.txt to add clang-format * Run clang-format on GDCpp and GDJS files
44 lines
1.2 KiB
C++
44 lines
1.2 KiB
C++
/*
|
|
* GDevelop Core
|
|
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
|
|
* reserved. This project is released under the MIT License.
|
|
*/
|
|
#include "PlatformManager.h"
|
|
#include "GDCore/Extensions/Platform.h"
|
|
|
|
namespace gd {
|
|
|
|
PlatformManager* PlatformManager::_singleton = NULL;
|
|
|
|
PlatformManager::PlatformManager() {}
|
|
|
|
PlatformManager::~PlatformManager() {}
|
|
|
|
bool PlatformManager::AddPlatform(std::shared_ptr<gd::Platform> newPlatform) {
|
|
for (std::size_t i = 0; i < platformsLoaded.size(); ++i) {
|
|
if (platformsLoaded[i]->GetName() == newPlatform->GetName()) return false;
|
|
}
|
|
|
|
platformsLoaded.push_back(newPlatform);
|
|
return true;
|
|
}
|
|
|
|
gd::Platform* PlatformManager::GetPlatform(
|
|
const gd::String& platformName) const {
|
|
for (std::size_t i = 0; i < platformsLoaded.size(); ++i) {
|
|
if (platformsLoaded[i]->GetName() == platformName)
|
|
return platformsLoaded[i].get();
|
|
}
|
|
|
|
return NULL;
|
|
}
|
|
|
|
void PlatformManager::NotifyPlatformIDEInitialized() const {
|
|
for (std::size_t i = 0; i < platformsLoaded.size(); ++i) {
|
|
if (platformsLoaded[i] != std::shared_ptr<gd::Platform>())
|
|
platformsLoaded[i]->OnIDEInitialized();
|
|
}
|
|
}
|
|
|
|
} // namespace gd
|