Fix issue in Rocket.lua script.
[cafu-Engine.git] / Ca3DE / GameInfo.cpp
blob37d9f282d46b816f2f18aa992f9b211c936c6457
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
7 #include "GameInfo.hpp"
8 #include "PlatformAux.hpp"
10 #include <stdexcept>
13 GameInfoT::GameInfoT(const std::string& GameName)
14 : m_GameName(GameName)
19 const std::string& GameInfoT::GetName() const
21 return m_GameName;
25 GameInfosT::GameInfosT()
27 const std::vector<std::string> GameNames = PlatformAux::GetDirectory("Games", 'd');
29 for (size_t i = 0; i < GameNames.size(); i++)
30 m_AllGameInfos.push_back(GameInfoT(GameNames[i]));
32 if (m_AllGameInfos.size() == 0)
33 throw std::runtime_error("Could not find any game in the Games subdirectory.");
35 m_GameInfo = m_AllGameInfos[0];