mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-22 01:55:25 -04:00
5d2e0786ee
* This should make it easier to identify and find actions/conditions. Categories give more clarity and icons help to identify what's available without reading everything.
37 lines
984 B
C++
37 lines
984 B
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;
|
|
}
|
|
|
|
} // namespace gd
|