 |
Cytopia
0.3
A city building simulation game
|
#include <Game.hxx>
Definition at line 24 of file Game.hxx.
◆ Game()
Creates a game.
Initializes all GameServices and starts the threads
Definition at line 33 of file Game.cxx.
◆ ~Game()
virtual Cytopia::Game::~Game |
( |
| ) |
|
|
virtualdefault |
◆ initialize()
void Cytopia::Game::initialize |
( |
| ) |
|
|
virtual |
starts setting up the game
starts game initialization.
Definition at line 55 of file Game.cxx.
57 #ifdef USE_MOFILEREADER
61 if (moFileLib::moFileReaderSingleton::GetInstance().ReadFile(moFilePath.c_str()) == moFileLib::moFileReader::EC_SUCCESS)
67 LOG(
LOG_ERROR) <<
"Failed to load MO file " << moFilePath;
◆ loadGame()
void Cytopia::Game::loadGame |
( |
const std::string & |
fileName | ) |
|
|
virtual |
◆ newGame()
void Cytopia::Game::newGame |
( |
bool |
generateTerrain | ) |
|
|
virtual |
◆ quit()
void Cytopia::Game::quit |
( |
| ) |
|
|
private |
Definition at line 39 of file Game.cxx.
43 m_AudioMixer.stopAll();
◆ run()
void Cytopia::Game::run |
( |
bool |
SkipMenu = false | ) |
|
|
virtual |
begins the game
starts running the game
- Parameters
-
SkipMenu | if the main menu should be skipped or not |
Definition at line 82 of file Game.cxx.
94 #ifdef USE_ANGELSCRIPT
95 ScriptEngine &scriptEngine = ScriptEngine::instance();
97 scriptEngine.loadScript(
fs::getBasePath() +
"/resources/test.as", ScriptCategory::BUILD_IN);
138 const float fpsIntervall = 1.0;
139 Uint32 fpsLastTime = SDL_GetTicks();
140 Uint32 fpsFrames = 0;
148 #ifdef MICROPROFILE_ENABLED
149 MICROPROFILE_SCOPEI(
"Map",
"Gameloop", MP_GREEN);
169 #ifdef USE_ANGELSCRIPT
170 ScriptEngine::instance().framestep(1);
178 if (fpsLastTime < SDL_GetTicks() - fpsIntervall * 1000)
180 fpsLastTime = SDL_GetTicks();
185 #ifdef MICROPROFILE_ENABLED
186 MicroProfileFlip(
nullptr);
◆ shutdown()
void Cytopia::Game::shutdown |
( |
| ) |
|
|
virtual |
◆ m_GamePlay
◆ m_shutDown
bool Cytopia::Game::m_shutDown = false |
|
private |
The documentation for this class was generated from the following files:
void loadMapFromFile(const std::string &fileName)
Load Map from file.
Game clock service. Implement two timers one real time timer and other game time timer.
virtual void loadGame(const std::string &fileName)
void centerScreenOnMapCenter()
Centers camera on the middle of the map.
Draws the UI to the screen.
void setFPSCounterText(const std::string &fps)
Helper function to update the FPS Counter.
virtual void newGame(bool generateTerrain)
void init()
Parses the UiLayout.json files and creates UI Elements.
a 3-dimensional coordinate
void renderMap() const
Render the elements contained in the Map.
void drawUI()
Renders all UI Widgets.
void tick(void)
This function provides the tick for both clocks.
std::string gameLanguage
the code for the current game language
std::string getBasePath()
Get base path (where Cytopia is being run)
void checkEvents(SDL_Event &event)
void newMap(bool generateTerrain=true)
Creates a new map object with terrain gen.
std::function< R(Args...)> slot(instance &object, R(Class::*method)(Args...))
This function creates a std::function by binding object to the member function pointer method.
void addPersistentMenu(GameMenu::Ptr menu)
void play(const SoundtrackID &id, int effect=AL_EFFECT_NULL)
Plays a Soundtrack given its ID and optionally applies an effect.
static Settings & instance(void)
Get an instance of the singleton.
virtual void initialize()
starts setting up the game
GameClock::ClockTaskHndl addRealTimeClockTask(ClockCbk cbk, DelayType delay, PeriodType period=TimePointZero)
Add new real time clock task.
void newImGuiFrame()
creates and renders a new ImGui frame