1 #ifndef GAMES_NEWTONIAN_TILE_H
2 #define GAMES_NEWTONIAN_TILE_H
14 #include <unordered_map>
16 #include <initializer_list>
18 #include "../../joueur/src/any.hpp"
20 #include "game_object.hpp"
22 #include "impl/newtonian_fwd.hpp"
165 Tile_(std::initializer_list<std::pair<std::string, Any&&>> init);
166 Tile_() : Tile_({}){}
167 virtual void resize(
const std::string& name, std::size_t size)
override;
168 virtual void change_vec_values(
const std::string& name, std::vector<std::pair<std::size_t, Any>>& values)
override;
169 virtual void remove_key(
const std::string& name, Any& key)
override;
170 virtual std::unique_ptr<Any> add_key_value(
const std::string& name, Any& key, Any& value)
override;
171 virtual bool is_map(
const std::string& name)
override;
172 virtual void rebind_by_name(Any* to_change,
const std::string& member, std::shared_ptr<Base_object> ref)
override;
183 #endif // GAMES_NEWTONIAN_TILE_H
bool is_pathable()
Checks if a Tile is pathable to units
const int & blueium
The amount of blueium on this tile.
Definition: tile.hpp:44
bool has_neighbor(const Tile &tile)
Checks if this Tile has a specific neighboring Tile
const bool & is_wall
Whether or not the tile is a wall.
Definition: tile.hpp:64
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:99
const Machine & machine
The Machine on this Tile if present, otherwise null.
Definition: tile.hpp:69
const Unit & unit
The Unit on this Tile if present, otherwise null.
Definition: tile.hpp:114
const int & blueium_ore
The amount of blueium ore on this tile.
Definition: tile.hpp:49
const int & decoration
(Visualizer only) Different tile types, cracked, slightly dirty, etc. This has no effect on gameplay...
Definition: tile.hpp:54
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:94
static const std::vector< std::string > directions
The list of all valid directions Tiles can be in
Definition: tile.hpp:134
const std::string & type
The type of Tile this is ('normal', 'generator', 'conveyor', or 'spawn').
Definition: tile.hpp:109
const int & redium
The amount of redium on this tile.
Definition: tile.hpp:79
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:89
const int & y
The y (vertical) position of this Tile.
Definition: tile.hpp:124
std::vector< Tile > get_neighbors()
Gets the neighbors of this Tile
A unit in the game. May be a manager, intern, or physicist.
Definition: unit.hpp:37
const int & redium_ore
The amount of redium ore on this tile.
Definition: tile.hpp:84
const int & x
The x (horizontal) position of this Tile.
Definition: tile.hpp:119
const Player & owner
The owner of this Tile, or null if owned by no-one. Only for generators and spawn areas...
Definition: tile.hpp:74
const std::string & direction
The direction of a conveyor belt ('blank', 'north', 'east', 'south', or 'west'). Blank means conveyor...
Definition: tile.hpp:59
An object in the game. The most basic class that all game classes should inherit from automatically...
Definition: game_object.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:104
A machine in the game. Used to refine ore.
Definition: machine.hpp:37
A Tile in the game that makes up the 2D map grid.
Definition: tile.hpp:37
A player in this game. Every AI controls one player.
Definition: player.hpp:37