diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-02-01 21:29:29 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-02-01 21:29:29 +0000 |
commit | 3f269783757f78d46d3b864ba6794401c42f4760 (patch) | |
tree | a1ccc742b9c91973464765920d06d1e9dd4045f1 /src/game.h | |
parent | 75feac69e27648fb50142756651270891c492537 (diff) | |
download | mana-3f269783757f78d46d3b864ba6794401c42f4760.tar.gz mana-3f269783757f78d46d3b864ba6794401c42f4760.tar.bz2 mana-3f269783757f78d46d3b864ba6794401c42f4760.tar.xz mana-3f269783757f78d46d3b864ba6794401c42f4760.zip |
Created a Game class.
Diffstat (limited to 'src/game.h')
-rw-r--r-- | src/game.h | 58 |
1 files changed, 22 insertions, 36 deletions
@@ -29,51 +29,37 @@ #define SPEECH_TIME 80 #define SPEECH_MAX_TIME 100 +class MessageHandler; class Network; extern std::string map_path; -extern int fps; +extern volatile int fps; extern volatile int tick_time; -extern int server_tick; -enum { - JOY_UP, - JOY_DOWN, - JOY_LEFT, - JOY_RIGHT, - JOY_BTN0, - JOY_BTN1, - JOY_BTN2, - JOY_BTN3, - JOY_BTN4, - JOY_BTN5, - JOY_BTN6, - JOY_BTN7, - JOY_BTN8, - JOY_BTN9, - JOY_BTN10, - JOY_BTN11 -}; +class Game +{ + public: + Game(Network *network); + ~Game(); -/** - * Main game loop - */ -void game(Network*); + void logic(); -/** - * Check user input - */ -void do_input(Network*); + void handleInput(); -/** - * Initialize - */ -void do_init(Network*); + protected: + Network *mNetwork; -/** - * Clean the engine - */ -void do_exit(); + MessageHandler *mBeingHandler; + MessageHandler *mBuySellHandler; + MessageHandler *mChatHandler; + MessageHandler *mEquipmentHandler; + MessageHandler *mInventoryHandler; + MessageHandler *mItemHandler; + MessageHandler *mNpcHandler; + MessageHandler *mPlayerHandler; + MessageHandler *mSkillHandler; + MessageHandler *mTradeHandler; +}; /** * Returns elapsed time. (Warning: very unsafe function, it supposes the delay |