#ifndef ENGINE_HPP_ #define ENGINE_HPP_ #include #include "entityx/deps/Dependencies.h" #include #include #include //game::engine::Systems->add>(); class Engine : public entityx::Receiver { public: bool shouldRun; 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) { shouldRun = !(gee.really); } }; namespace game { extern entityx::EventManager events; extern entityx::EntityManager entities; extern Engine engine; inline void endGame(void) { events.emit(); } extern SpriteLoader sprite_l; } #endif // ENGINE_HPP_