#ifndef HANDLER_H #define HANDLER_H #include #include class Level; class Cell; class Sprite; class Item; class Bomb; class Blast; class Player; class AI_Player; class KNet; class Exit; class Rule; class Handler { public: Handler(); ~Handler(); void loop(); static void event(GGZdMod *ggzdmod, GGZdModEvent event, const void *data); void dataEvent(GGZdMod *mod, int fd); void joinEvent(GGZdMod *mod, int fd); void leaveEvent(GGZdMod *mod, int fd); enum States { state_launched, state_map, state_waiting, state_playing }; private: void checkStart(GGZdMod *mod); void moveMonsters(); void progress(); Item *findItem(int x, int y); void checkItem(Player *p, bool isplayer); bool walkableTile(int x, int y); bool placeBlast(int x, int y); void createMonster(int count); void createMonster(int id, int x, int y); static int generator(); KNet *net; Level *level; Rule *rules; int m_state; char *selected_map; int selected_bots; int selected_players; Exit *exit; std::list monsterlist; std::list playerlist; std::list blastlist; std::list bomblist; std::list itemlist; std::list freecelllist; }; #endif