76 std::swap(data, rhs.data);
112 void clear(
bool transparent=
false,
bool walkable=
false);
245 bool isWalkable(
int x,
int y)
const;
266 int getHeight()
const;
269 void setInFov(
int x,
int y,
bool fov);
270 int getNbCells()
const;
271 friend class TCODLIB_API TCODPath;
272 friend class TCODLIB_API TCODDijkstra;
282typedef std::unique_ptr<struct TCOD_Map, MapDeleter_> MapPtr_;
int getWidth() const
You can retrieve the map size with :int TCODMap::getWidth() const int TCODMap::getHeight() constint T...
bool isInFov(int x, int y) const
Once your computed the field of view, you can know if a cell is visible with :
void copy(const TCODMap *source)
You can copy an existing map into another.
void setProperties(int x, int y, bool isTransparent, bool isWalkable)
Then, build your dungeon by defining which cells let the light pass (by default, all cells block the ...
TCODMap(int width, int height)
First, you have to allocate a map of the same size as your dungeon.
bool isTransparent(int x, int y) const
You can also retrieve transparent/walkable information with :bool TCODMap::isTransparent(int x,...
void computeFov(int playerX, int playerY, int maxRadius=0, bool light_walls=true, TCOD_fov_algorithm_t algo=FOV_BASIC)
Once your map is allocated and empty cells have been defined, you can calculate the field of view wit...
void clear(bool transparent=false, bool walkable=false)
You can clear an existing map (setting all cells to the chosen walkable/transparent values) with:void...
struct TCOD_Map TCOD_Map
Private map struct.
TCOD_fov_algorithm_t
Definition fov_types.h:63
void TCOD_map_delete(TCOD_Map *map)
Free a TCOD_Map object.
@ FOV_BASIC
Trace multiple Bresenham lines along the perimeter.
Definition fov_types.h:69
The libtcod namespace.
Definition bresenham.hpp:157