Files
GDevelop/Core/GDCore/IDE/PlatformManager.cpp
Florian Rival 5d2e0786ee Sort actions/conditions in categories add icons to their groups (#3583)
* 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.
2022-02-03 11:45:53 +01:00

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