summaryrefslogtreecommitdiff
path: root/src/game.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.h')
-rw-r--r--src/game.h58
1 files changed, 22 insertions, 36 deletions
diff --git a/src/game.h b/src/game.h
index a1a3cc22..ca7f0ed8 100644
--- a/src/game.h
+++ b/src/game.h
@@ -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