diff options
Diffstat (limited to 'src/core/application.h')
-rw-r--r-- | src/core/application.h | 53 |
1 files changed, 36 insertions, 17 deletions
diff --git a/src/core/application.h b/src/core/application.h index b2d8467..fbaba9d 100644 --- a/src/core/application.h +++ b/src/core/application.h @@ -24,36 +24,44 @@ class Application public: /// default constructor Application(); - + /// default destructor virtual ~Application(); - -/*----- inspectors ----------------------------------------------- */ + + /*----- inspectors ----------------------------------------------- */ /// the current application time, in microseconds - inline unsigned long timestamp() const { return application_timestamp; } - + inline unsigned long timestamp() const { + return application_timestamp; + } + /// the current application time, in seconds - float time() const { return ((float)(timestamp()) / 1000.0f); } + float time() const { + return ((float)(timestamp()) / 1000.0f); + } /// true if the core is connected to a running game interface - inline bool connected() const { return (application_game && application_game->running()); } + inline bool connected() const { + return (application_game && application_game->running()); + } /// return the game interface, returns 0 if the application is not connected to a game - inline GameInterface *game() { return application_game; } + inline GameInterface *game() { + return application_game; + } -/*----- mutators ------------------------------------------------- */ + /*----- mutators ------------------------------------------------- */ /// start the server or connect to remote host void connect(std::string const &host); - + /// disconnect from the game module void disconnect(); /// load a module bool load(std::string const &module_name); -/*----- virtual mutators ------------------------------------------ */ + /*----- virtual mutators ------------------------------------------ */ /// initialize the application virtual void init(int count, char **arguments); @@ -64,7 +72,7 @@ public: /// quit the application without proper shutdown virtual void quit(int status); -/*----- notifications --------------------------------------------- */ + /*----- notifications --------------------------------------------- */ /// sound notifications from the core to the application virtual void notify_sound(const char * name); @@ -85,7 +93,9 @@ public: virtual void notify_zonechange(); /// a pointer to the current application instance - static inline Application *instance() { return application_instance; } + static inline Application *instance() { + return application_instance; + } protected: /// run a core frame @@ -96,7 +106,7 @@ protected: /// load exra config void load_autoexec(); - + /// save cvar config void save_config(); @@ -125,13 +135,22 @@ private: }; /// pointer to the application -inline Application *application() { return Application::instance(); } +inline Application *application() +{ + return Application::instance(); +} /// pointer to the console -inline sys::ConsoleInterface *console() { return sys::ConsoleInterface::instance(); } +inline sys::ConsoleInterface *console() +{ + return sys::ConsoleInterface::instance(); +} /// pointer to the game interface -inline GameInterface *game() { return Application::instance()->game(); } +inline GameInterface *game() +{ + return Application::instance()->game(); +} } |