/* 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 &local_player; } /*----- 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 sec time since the previous frame, in seconds virtual void frame(float seconds) = 0; protected: Player local_player; }; } #endif // __INCLUDED_CORE_GAMEINTERFACE_H__