48 lines
1.0 KiB
C++
48 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include <SFML/Graphics/RenderWindow.hpp>
|
|
|
|
#include "Engine/Graphics/UI.hpp"
|
|
#include "Engine/Graphics/DebugUI.hpp"
|
|
#include "Engine/Utils/Timers.hpp"
|
|
|
|
|
|
typedef enum eGameStatus {
|
|
GAME_INIT,
|
|
GAME_RUNNING,
|
|
GAME_QUIT
|
|
} GAME_STATUS;
|
|
|
|
class Game final {
|
|
public:
|
|
static Game& getInstance(bool dbgFlag) {
|
|
if (smInstance == nullptr)
|
|
smInstance = new Game(dbgFlag);
|
|
|
|
return *smInstance;
|
|
}
|
|
~Game() = default;
|
|
|
|
Game(Game&&) = default;
|
|
Game& operator= (Game&&) = default;
|
|
Game(Game const&) = delete;
|
|
Game& operator= (Game const&) = delete;
|
|
|
|
GAME_STATUS Tick(SysTimer& time);
|
|
|
|
private:
|
|
Game(bool dbgFlag) noexcept(false);
|
|
static Game* smInstance;
|
|
|
|
void InitWindows();
|
|
void Update();
|
|
void Render();
|
|
|
|
bool mbDbgModeEnabled;
|
|
std::unique_ptr<DebugUI> mDbgUI = nullptr;
|
|
|
|
std::shared_ptr<sf::RenderWindow> mMainWindow = nullptr;
|
|
std::unique_ptr<CockpitUI> mCockpitUI = nullptr;
|
|
std::unique_ptr<WorldUI> mWorldUI = nullptr;
|
|
|
|
}; |