adg5/Map.h

29 lines
722 B
C++

#pragma once
struct Tile {
bool explored; // has the player already seen this tile ?
Tile() : explored(false) {}
};
class Map {
public:
int width, height;
Map(int width, int height);
~Map();
bool canWalk(int x, int y) const;
bool isWall(int x, int y) const;
bool isInFov(int x, int y) const;
bool isExplored(int x, int y) const;
void computeFov();
void render(TCOD_Console& cons) const;
void addItem(int x, int y);
protected:
Tile* tiles;
friend class BspListener;
TCODMap* map;
void dig(int x1, int y1, int x2, int y2);
void createRoom(bool first, int x1, int y1, int x2, int y2);
void addMonster(int x, int y);
void setWall(int x, int y);
};