1 #ifndef GAMES_SALOON_TILE_H
2 #define GAMES_SALOON_TILE_H
14 #include <unordered_map>
16 #include <initializer_list>
18 #include "../../joueur/src/any.hpp"
20 #include "game_object.hpp"
22 #include "impl/saloon_fwd.hpp"
140 Tile_(std::initializer_list<std::pair<std::string, Any&&>> init);
141 Tile_() : Tile_({}){}
142 virtual void resize(
const std::string& name, std::size_t size)
override;
143 virtual void change_vec_values(
const std::string& name, std::vector<std::pair<std::size_t, Any>>& values)
override;
144 virtual void remove_key(
const std::string& name, Any& key)
override;
145 virtual std::unique_ptr<Any> add_key_value(
const std::string& name, Any& key, Any& value)
override;
146 virtual bool is_map(
const std::string& name)
override;
147 virtual void rebind_by_name(Any* to_change,
const std::string& member, std::shared_ptr<Base_object> ref)
override;
158 #endif // GAMES_SALOON_TILE_H
An object in the game. The most basic class that all game classes should inherit from automatically...
Definition: game_object.hpp:37
const Cowboy & cowboy
The Cowboy that is on this Tile, null otherwise.
Definition: tile.hpp:49
bool has_neighbor(const Tile &tile)
Checks if this Tile has a specific neighboring Tile
A person on the map that can move around and interact within the saloon.
Definition: cowboy.hpp:37
const int & y
The y (vertical) position of this Tile.
Definition: tile.hpp:94
const Tile & tile_north
The Tile to the 'North' of this one (x, y-1). Null if out of bounds of the map.
Definition: tile.hpp:74
const Young_gun & young_gun
The YoungGun on this tile, null otherwise.
Definition: tile.hpp:99
const bool & has_hazard
If this Tile is pathable, but has a hazard that damages Cowboys that path through it...
Definition: tile.hpp:59
static const std::vector< std::string > directions
The list of all valid directions Tiles can be in
Definition: tile.hpp:109
A Tile in the game that makes up the 2D map grid.
Definition: tile.hpp:37
const Tile & tile_west
The Tile to the 'West' of this one (x-1, y). Null if out of bounds of the map.
Definition: tile.hpp:84
const Furnishing & furnishing
The furnishing that is on this Tile, null otherwise.
Definition: tile.hpp:54
An eager young person that wants to join your gang, and will call in the veteran Cowboys you need to ...
Definition: young_gun.hpp:37
A bottle thrown by a bartender at a Tile.
Definition: bottle.hpp:37
std::vector< Tile > get_neighbors()
Gets the neighbors of this Tile
const bool & is_balcony
If this Tile is a balcony of the Saloon that YoungGuns walk around on, and can never be pathed throug...
Definition: tile.hpp:64
An furnishing in the Saloon that must be pathed around, or destroyed.
Definition: furnishing.hpp:37
const Bottle & bottle
The beer Bottle currently flying over this Tile, null otherwise.
Definition: tile.hpp:44
const Tile & tile_south
The Tile to the 'South' of this one (x, y+1). Null if out of bounds of the map.
Definition: tile.hpp:79
const int & x
The x (horizontal) position of this Tile.
Definition: tile.hpp:89
const Tile & tile_east
The Tile to the 'East' of this one (x+1, y). Null if out of bounds of the map.
Definition: tile.hpp:69
bool is_pathable()
Checks if a Tile is pathable to units