#ifndef ENGINE_HPP_ #define ENGINE_HPP_ #include #include class Engine : public entityx::Receiver { private: bool gameRunning; public: entityx::SystemManager systems; explicit Engine(void); void init(void); void render(entityx::TimeDelta dt); void update(entityx::TimeDelta dt); template inline T* getSystem(void) { return dynamic_cast(systems.system().get()); } /*void configure(entityx::EventManager &ev) { (void)ev; }*/ inline void receive(const GameEndEvent &gee) { gameRunning = !(gee.really); } inline bool shouldRun(void) const { return gameRunning; } }; namespace game { extern entityx::EventManager events; extern entityx::EntityManager entities; extern Engine engine; inline void endGame(void) { events.emit(); } } #endif // ENGINE_HPP_