diff -r b81cb670e6b2 -r af75a1894a32 src/proto2/Engine.hh --- a/src/proto2/Engine.hh Sun Nov 09 20:40:46 2008 +0000 +++ b/src/proto2/Engine.hh Sun Nov 09 21:51:13 2008 +0000 @@ -1,4 +1,11 @@ +#ifndef ENGINE_HH +#define ENGINE_HH +// XXX: forward-declare Engine for other components +class Engine; + +#include "GameState.hh" +#include "Graphics.hh" #include "NetworkServer.hh" #include "NetworkClient.hh" @@ -9,25 +16,38 @@ // game state GameState game_state; + // Graphics/Input + Graphics *graphics; + // network server/client NetworkServer *net_server; NetworkClient *net_client; // to exit the mainloop bool is_running; - + + public: // default constructor Engine (void); - public: - static void runNetworkServer (const std::string &listen_port); - static void runNetworkClient (const std::string &connect_host, const std::string &connect_port); + // setup graphics + void setupGraphics (void); - // logging utility + // set up network server/client + // setting up both of these will lead to odd behaviour :) + void setupNetworkServer (const std::string &listen_port); + void setupNetworkClient (const std::string &connect_host, const std::string &connect_port); + + // run the main loop + void run (void); + + // terminate the main loop + void stop (void); + + public: + // logging utility static Logger log (enum LogLevel level, const char *type); - private: - void main_loop (void); - }; +#endif /* ENGINE_HH */