41 lines
844 B
C++
41 lines
844 B
C++
#pragma once
|
|
class Actor;
|
|
class Map;
|
|
class Gui;
|
|
|
|
#include "libtcod.hpp"
|
|
|
|
class Engine {
|
|
public:
|
|
enum GameStatus {
|
|
STARTUP,
|
|
IDLE,
|
|
NEW_TURN,
|
|
VICTORY,
|
|
DEFEAT,
|
|
QUIT
|
|
} gameStatus;
|
|
|
|
int screenWidth;
|
|
int screenHeight;
|
|
TCOD_mouse_t mouse;
|
|
TCODList<Actor*> actors;
|
|
Actor* player;
|
|
Map* map;
|
|
Gui* gui;
|
|
int fovRadius;
|
|
tcod::Context *context;
|
|
tcod::Console* console;
|
|
Engine(int screenWidth, int screenHeight, tcod::Context *context, tcod::Console *console);
|
|
void init();
|
|
~Engine();
|
|
bool update();
|
|
void render(bool present = true);
|
|
void sendToBack(Actor* actor);
|
|
Actor* getClosestMonster(int x, int y, float range) const;
|
|
bool pickATile(int* x, int* y, float maxRange = 0.0f);
|
|
private:
|
|
bool computeFov;
|
|
};
|
|
|
|
extern Engine *engine; |