adg5/Engine.h
2025-04-21 17:03:26 +10:00

46 lines
951 B
C++

#pragma once
class Actor;
class Map;
class Gui;
#include "libtcod.hpp"
class Engine {
public:
enum GameStatus {
STARTUP,
IDLE,
NEW_TURN,
VICTORY,
DEFEAT,
PAUSE,
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();
void term();
~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);
Actor* getActor(int x, int y) const;
void load();
void save();
private:
bool computeFov;
};
extern Engine *engine;