7 #include "GameObject.h"
42 Scene(
const std::string& name, std::function<
void(
void)>&&
init);
70 const std::string&
getName()
const;
74 void setExit(std::function<
void(
void)>&& exit);
77 std::function<void(void)> m_init, m_exit;
102 static void setScene(
const std::string& name);
133 s_plugins.push_back(t);
139 static void changeScene();
141 static bool s_game_running, s_change_scene;
142 static std::map<std::string, Scene>::iterator s_current_scene, s_next_scene;
143 static std::map<std::string, Scene> s_scenes;
144 static std::vector<Plugin*> s_plugins;
Game class.
Definition: Game.h:23
static void addScene(Scene &scene)
Add a Scene to the Game.
static void setScene(const std::string &name)
Set Scene with name name as the current Scene.
static bool isRunning()
Get if the Game is running.
Scene(const std::string &name, std::function< void(void)> &&init)
Class constructor.
Scene of a Game.
Definition: Game.h:34
static void addPlugin()
Add Plugin to the Game.
Definition: Game.h:130
void exit()
Called when Scene is being unset (Game is changing the current Scene or Game is ending).
const std::string & getName() const
Get Scene's name.
static void running(bool running)
Set if the Game is running.
Definition: Box2DPlugin.h:6
void init()
Called when Scene is being set.
void setExit(std::function< void(void)> &&exit)
Set Scene's exit function.
~Scene()
Class destructor.
static void run()
Run the Game.