#ifndef REFEREE_H #define REFEREE_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "board.h" #include "pacman.h" #include "monster.h" #include "fruit.h" #include "energizer.h" #include "bitfont.h" #include "painter.h" enum { Init, Introducing, Playing, Demonstration, Paused, Player, Ready, Scoring, LevelDone, Dying, GameOver, HallOfFame }; class Referee : public TQWidget { Q_OBJECT public: Referee (TQWidget *parent=0, const char *name=0, int scheme=-1, int mode=-1, Bitfont *font=0); void setSkill(int); void setRoom(int); public slots: void setScheme(int scheme, int mode, Bitfont *font=0); void levelUp(); void levelUpPlay(); void pause(); void ready(); void intro(); void introPlay(); void hallOfFame(); void demo(); void play(); void killed(); void killedPlay(); void eaten(); void toggleHallOfFame(); void setFocusOutPause(bool focusOutPause); void setFocusInContinue(bool focusInContinue); void initKeys(); void repaintFigures(); private slots: void start(); void stop(); void stopEnergizer(); signals: void setScore(int, int); void setPoints(int); void setLevel(int); void setLifes(int); void focusedGamePause(); void forcedGameHighscores(); protected: void timerEvent(TQTimerEvent *); void paintEvent(TQPaintEvent *); void keyPressEvent(TQKeyEvent *); void focusOutEvent(TQFocusEvent *); void focusInEvent(TQFocusEvent *); void fillArray(TQArray &, TQString, int); void fillStrList(TQStrList &, TQString, int); void fillMapName(); void confScheme(); void confLevels(bool defGroup=TRUE); void confMisc(bool defGroup=TRUE); void confTiming(bool defGroup=TRUE); void confScoring(bool defGroup=TRUE); private: TQBitArray gameState; int timerCount; int maxLevel; int scheme; int mode; TQString pixmapDirectory; TQString mapDirectory; TQStrList mapName; TQArray speed; TQArray monsterIQ; TQArray fruitIQ; TQArray fruitIndex; TQArray pacmanTicks; TQArray remTicks; TQArray dangerousTicks; TQArray harmlessTicks; TQArray harmlessDurTicks; TQArray harmlessWarnTicks; TQArray arrestTicks; TQArray arrestDurTicks; TQArray fruitTicks; TQArray fruitAppearsTicks; TQArray fruitDurTicks; TQArray fruitScoreDurTicks; int monsterScoreDurMS; int playerDurMS; int readyDurMS; int gameOverDurMS; int afterPauseMS; int dyingPreAnimationMS; int dyingAnimationMS; int dyingPostAnimationMS; int introAnimationMS; int introPostAnimationMS; int levelUpPreAnimationMS; int levelUpAnimationMS; int energizerAnimationMS; int pointScore; int energizerScore; TQArray fruitScore; TQArray monsterScore; TQArray extraLifeScore; int extraLifeScoreIndex; int nextExtraLifeScore; int monstersEaten; int points; int lifes; int level; bool focusedPause; bool focusOutPause; bool focusInContinue; Board *board; Painter *pix; Pacman *pacman; Fruit *fruit; TQPtrList *monsters; TQPtrList *monsterRect; TQPtrList *energizers; TQPtrList *energizerRect; TQRect pacmanRect; TQRect fruitRect; void introMonster(int id); void introPaint(int t); void initMonsters(); void initPacman(); void initFruit(bool fullInitialization=TRUE); void initEnergizers(); void setOnEnergizers(); int gameTimer; int energizerTimer; void start(int); void init(bool); void score(int); uint UpKey; uint DownKey; uint RightKey; uint LeftKey; }; #endif // REFEREE_H