47 lines
749 B
C++
47 lines
749 B
C++
|
class Engine {
|
||
|
public :
|
||
|
enum GameStatus {
|
||
|
STARTUP,
|
||
|
IDLE,
|
||
|
NEW_TURN,
|
||
|
VICTORY,
|
||
|
DEFEAT
|
||
|
} gameStatus;
|
||
|
|
||
|
int fovRadius;
|
||
|
TCODList<Actor *> actors;
|
||
|
Actor *player;
|
||
|
Actor *stairs;
|
||
|
Map *map;
|
||
|
|
||
|
TCOD_key_t lastKey;
|
||
|
TCOD_mouse_t mouse;
|
||
|
|
||
|
int screenWidth;
|
||
|
int screenHeight;
|
||
|
Gui *gui;
|
||
|
|
||
|
Engine(int screenWidth, int screenHeight);
|
||
|
~Engine();
|
||
|
void update();
|
||
|
void render();
|
||
|
void sendToBack(Actor *actor);
|
||
|
|
||
|
Actor *getClosestMonster(int x, int y, float range) const;
|
||
|
Actor *getActor(int x, int y) const;
|
||
|
bool pickATile(int *x, int *y, float maxRange = 0.0f);
|
||
|
|
||
|
int level;
|
||
|
|
||
|
|
||
|
void nextLevel();
|
||
|
void init();
|
||
|
void term();
|
||
|
void load();
|
||
|
void save();
|
||
|
|
||
|
void log(unsigned char *msg);
|
||
|
};
|
||
|
|
||
|
extern Engine engine;
|