C++ Joueur Client
|
A Tile in the game that makes up the 2D map grid. More...
#include <tile.hpp>
Public Member Functions | |
bool | res (int num) |
resurrect the corpses on this tile into _zombies. More... | |
bool | spawn_unit (const std::string &title) |
spawns a fighting unit on the correct tile. More... | |
bool | spawn_worker () |
spawns a worker on the correct tile. More... | |
std::vector< Tile > | get_neighbors () |
Gets the neighbors of this Tile More... | |
bool | is_pathable () |
Checks if a Tile is pathable to units More... | |
bool | has_neighbor (const Tile &tile) |
Checks if this Tile has a specific neighboring Tile More... | |
void | log (const std::string &message) |
adds a message to this _game_object's logs. _intended for your own debugging purposes, as strings stored here are saved in the gamelog. More... | |
template<typename T > | |
std::shared_ptr< typename T::element_type > | as () |
Dynamically casts this object to another type. Returns nullptr if it cannot be converted to the type. More... | |
template<typename T > | |
bool | is () |
Determines if this object is of the specified object type More... | |
Public Attributes | |
const int & | corpses |
The amount of corpses on this tile. More... | |
const bool & | is_castle |
Whether or not the tile is a castle tile. More... | |
const bool & | is_gold_mine |
Whether or not the tile is considered to be a gold mine or not. More... | |
const bool & | is_grass |
Whether or not the tile is considered grass or not (Workers can walk on grass). More... | |
const bool & | is_island_gold_mine |
Whether or not the tile is considered to be the island gold mine or not. More... | |
const bool & | is_path |
Whether or not the tile is considered a path or not (Units can walk on paths). More... | |
const bool & | is_river |
Whether or not the tile is considered a river or not. More... | |
const bool & | is_tower |
Whether or not the tile is considered a tower or not. More... | |
const bool & | is_unit_spawn |
Whether or not the tile is the unit spawn. More... | |
const bool & | is_wall |
Whether or not the tile can be moved on by workers. More... | |
const bool & | is_worker_spawn |
Whether or not the tile is the worker spawn. More... | |
const int & | num_ghouls |
The amount of Ghouls on this tile. More... | |
const int & | num_hounds |
The amount of Hounds on this tile. More... | |
const int & | num_zombies |
The amount of Zombies on this tile. More... | |
const Player & | owner |
Which player owns this tile, only applies to grass tiles for workers, NULL otherwise. More... | |
const Tile & | tile_east |
The Tile to the 'East' of this one (x+1, y). Null if out of bounds of the map. More... | |
const Tile & | tile_north |
The Tile to the 'North' of this one (x, y-1). Null if out of bounds of the map. More... | |
const Tile & | tile_south |
The Tile to the 'South' of this one (x, y+1). Null if out of bounds of the map. More... | |
const Tile & | tile_west |
The Tile to the 'West' of this one (x-1, y). Null if out of bounds of the map. More... | |
const Tower & | tower |
The Tower on this Tile if present, otherwise null. More... | |
const Unit & | unit |
The Unit on this Tile if present, otherwise null. More... | |
const int & | x |
The x (horizontal) position of this Tile. More... | |
const int & | y |
The y (vertical) position of this Tile. More... | |
const std::string & | game_object_name |
String representing the top level Class that this game object is an instance of. Used for reflection to create new instances on clients, but exposed for convenience should AIs want this data. More... | |
const std::string & | id |
A unique id for each instance of a GameObject or a sub class. Used for client and server communication. Should never change value after being set. More... | |
const std::vector< std::string > & | logs |
Any strings logged will be stored here. Intended for debugging. More... | |
Static Public Attributes | |
static const std::vector < std::string > | directions |
The list of all valid directions Tiles can be in More... | |
A Tile in the game that makes up the 2D map grid.
|
inlineinherited |
Dynamically casts this object to another type. Returns nullptr if it cannot be converted to the type.
std::vector<Tile> cpp_client::necrowar::Tile::get_neighbors | ( | ) |
Gets the neighbors of this Tile
bool cpp_client::necrowar::Tile::has_neighbor | ( | const Tile & | tile | ) |
|
inlineinherited |
Determines if this object is of the specified object type
bool cpp_client::necrowar::Tile::is_pathable | ( | ) |
Checks if a Tile is pathable to units
|
inherited |
adds a message to this _game_object's logs. _intended for your own debugging purposes, as strings stored here are saved in the gamelog.
message | A string to add to this GameObject's log. Intended for debugging. |
bool cpp_client::necrowar::Tile::res | ( | int | num | ) |
resurrect the corpses on this tile into _zombies.
num | Number of zombies to resurrect. |
bool cpp_client::necrowar::Tile::spawn_unit | ( | const std::string & | title | ) |
spawns a fighting unit on the correct tile.
title | The title of the desired unit type. |
bool cpp_client::necrowar::Tile::spawn_worker | ( | ) |
spawns a worker on the correct tile.
const int& cpp_client::necrowar::Tile::corpses |
The amount of corpses on this tile.
|
static |
The list of all valid directions Tiles can be in
|
inherited |
String representing the top level Class that this game object is an instance of. Used for reflection to create new instances on clients, but exposed for convenience should AIs want this data.
|
inherited |
A unique id for each instance of a GameObject or a sub class. Used for client and server communication. Should never change value after being set.
const bool& cpp_client::necrowar::Tile::is_castle |
Whether or not the tile is a castle tile.
const bool& cpp_client::necrowar::Tile::is_gold_mine |
Whether or not the tile is considered to be a gold mine or not.
const bool& cpp_client::necrowar::Tile::is_grass |
Whether or not the tile is considered grass or not (Workers can walk on grass).
const bool& cpp_client::necrowar::Tile::is_island_gold_mine |
Whether or not the tile is considered to be the island gold mine or not.
const bool& cpp_client::necrowar::Tile::is_path |
Whether or not the tile is considered a path or not (Units can walk on paths).
const bool& cpp_client::necrowar::Tile::is_river |
Whether or not the tile is considered a river or not.
const bool& cpp_client::necrowar::Tile::is_tower |
Whether or not the tile is considered a tower or not.
const bool& cpp_client::necrowar::Tile::is_unit_spawn |
Whether or not the tile is the unit spawn.
const bool& cpp_client::necrowar::Tile::is_wall |
Whether or not the tile can be moved on by workers.
const bool& cpp_client::necrowar::Tile::is_worker_spawn |
Whether or not the tile is the worker spawn.
|
inherited |
Any strings logged will be stored here. Intended for debugging.
const int& cpp_client::necrowar::Tile::num_ghouls |
The amount of Ghouls on this tile.
const int& cpp_client::necrowar::Tile::num_hounds |
The amount of Hounds on this tile.
const int& cpp_client::necrowar::Tile::num_zombies |
The amount of Zombies on this tile.
const Player& cpp_client::necrowar::Tile::owner |
Which player owns this tile, only applies to grass tiles for workers, NULL otherwise.
const Tile& cpp_client::necrowar::Tile::tile_east |
The Tile to the 'East' of this one (x+1, y). Null if out of bounds of the map.
const Tile& cpp_client::necrowar::Tile::tile_north |
The Tile to the 'North' of this one (x, y-1). Null if out of bounds of the map.
const Tile& cpp_client::necrowar::Tile::tile_south |
The Tile to the 'South' of this one (x, y+1). Null if out of bounds of the map.
const Tile& cpp_client::necrowar::Tile::tile_west |
The Tile to the 'West' of this one (x-1, y). Null if out of bounds of the map.
const int& cpp_client::necrowar::Tile::x |
The x (horizontal) position of this Tile.
const int& cpp_client::necrowar::Tile::y |
The y (vertical) position of this Tile.