terom@25: #ifndef ENGINE_HH terom@25: #define ENGINE_HH terom@21: terom@25: // XXX: forward-declare Engine for other components terom@25: class Engine; terom@25: terom@25: #include "GameState.hh" terom@25: #include "Graphics.hh" terom@21: #include "NetworkServer.hh" terom@21: #include "NetworkClient.hh" terom@21: terom@23: #include "Logger.hh" terom@23: terom@21: class Engine { terom@24: private: terom@24: // game state terom@24: GameState game_state; terom@24: terom@25: // Graphics/Input terom@25: Graphics *graphics; terom@25: terom@24: // network server/client terom@24: NetworkServer *net_server; terom@24: NetworkClient *net_client; terom@21: terom@24: // to exit the mainloop terom@24: bool is_running; terom@25: terom@25: public: terom@24: // default constructor terom@24: Engine (void); terom@21: terom@25: // setup graphics terom@25: void setupGraphics (void); terom@24: terom@25: // set up network server/client terom@25: // setting up both of these will lead to odd behaviour :) terom@25: void setupNetworkServer (const std::string &listen_port); terom@25: void setupNetworkClient (const std::string &connect_host, const std::string &connect_port); terom@25: terom@25: // run the main loop terom@25: void run (void); terom@25: terom@25: // terminate the main loop terom@25: void stop (void); terom@25: terom@25: public: terom@25: // logging utility terom@24: static Logger log (enum LogLevel level, const char *type); terom@22: terom@21: }; terom@23: terom@25: #endif /* ENGINE_HH */