From d198b7b8d9ff713d891f35ab173d1f428f610e7d Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 16 Feb 2008 14:31:02 +0000 Subject: code cleanup --- src/core/gameinterface.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/core/gameinterface.h') diff --git a/src/core/gameinterface.h b/src/core/gameinterface.h index 4b18a9e..457df86 100644 --- a/src/core/gameinterface.h +++ b/src/core/gameinterface.h @@ -12,14 +12,18 @@ namespace core { +/// broadcast a network message to all players +void message_broadcast(std::string const & message, int ignoreplayer=-1); + +/// send a message to a player +void message_send(Player &player, std::string const & message); + /// abstract interface from the core to the game-specific code -/** The real game class has to derive from this class - */ class GameInterface { public: /// create a new game - GameInterface(const char *game_name = 0); + GameInterface(const char *gamename = 0); /// destroy the game virtual ~GameInterface(); @@ -29,9 +33,6 @@ public: /// true if the game is ready and running bool connected; - /// time the game has been running, in seconds - float current_time; - /// run one frame of the game /// @param sec time since the previous frame, in seconds virtual void frame(float seconds) = 0; @@ -51,9 +52,15 @@ public: static GameInterface *gameinterface_instance; /// the name of the game - std::string name; + std::string const & name(); + +private: + std::string game_name; }; +/// pointer to the current GameInterface +GameInterface *game(); + } #endif // __INCLUDED_CORE_GAMEINTERFACE_H__ -- cgit v1.2.3