/* core/gameinterface.h This file is part of the Osirion project and is distributed under the terms of the GNU General Public License version 2 */ #ifndef __INCLUDED_CORE_GAMEINTERFACE_H__ #define __INCLUDED_CORE_GAMEINTERFACE_H__ #include "core/player.h" namespace core { /// abstract interface from the core to the game-specific code class GameInterface { public: /// create a new game GameInterface(); /// destroy the game virtual ~GameInterface(); /*----- inspectors ---------------------------------------------- */ /// return the local player inline Player *localplayer() { return &game_localplayer; } /*----- virtual inspectors --------------------------------------- */ /// returns true if the game server can run a time frime virtual bool running() = 0; /*----- mutators ------------------------------------------------- */ /// clear all game variables, game functions and entities void clear(); /*----- virtual mutators ------------------------------------------ */ /// run one game time frame /// @param seconds time since the previous frame, in seconds virtual void frame(float seconds) = 0; protected: /// the local player static Player game_localplayer; }; /// global local player instance Player *localplayer(); /// global local control instance EntityControlable *localcontrol(); } #endif // __INCLUDED_CORE_GAMEINTERFACE_H__