1 #ifndef GAMES_NEWTONIAN_UNIT_H
2 #define GAMES_NEWTONIAN_UNIT_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"
124 bool drop(
const Tile&
tile,
int amount,
const std::string& material);
138 bool pickup(
const Tile&
tile,
int amount,
const std::string& material);
151 Unit_(std::initializer_list<std::pair<std::string, Any&&>> init);
152 Unit_() : Unit_({}){}
153 virtual void resize(
const std::string& name, std::size_t size)
override;
154 virtual void change_vec_values(
const std::string& name, std::vector<std::pair<std::size_t, Any>>& values)
override;
155 virtual void remove_key(
const std::string& name, Any& key)
override;
156 virtual std::unique_ptr<Any> add_key_value(
const std::string& name, Any& key, Any& value)
override;
157 virtual bool is_map(
const std::string& name)
override;
158 virtual void rebind_by_name(Any* to_change,
const std::string& member, std::shared_ptr<Base_object> ref)
override;
169 #endif // GAMES_NEWTONIAN_UNIT_H
const int & moves
The number of moves this unit has left this turn.
Definition: unit.hpp:69
bool act(const Tile &tile)
makes the unit do something to a machine or unit adjacent to its tile. _interns sabotage, physicists work. _interns stun physicist, physicist stuns manager, manager stuns intern.
const Tile & tile
The Tile this Unit is on.
Definition: unit.hpp:99
bool drop(const Tile &tile, int amount, const std::string &material)
drops materials at the units feet or adjacent tile.
const bool & acted
Whether or not this Unit has performed its action this turn.
Definition: unit.hpp:44
const int & health
The remaining health of a unit.
Definition: unit.hpp:59
bool attack(const Tile &tile)
attacks a unit on an adjacent tile.
const int & stun_time
Duration the unit is stunned. (0 to the game constant stunTime).
Definition: unit.hpp:94
const Job & job
The Job this Unit has.
Definition: unit.hpp:64
bool move(const Tile &tile)
moves this _unit from its current _tile to an adjacent _tile.
const int & redium
The amount of redium carried by this unit. (0 to job carry capacity - other carried items)...
Definition: unit.hpp:79
const int & redium_ore
The amount of redium ore carried by this unit. (0 to job carry capacity - other carried items)...
Definition: unit.hpp:84
A unit in the game. May be a manager, intern, or physicist.
Definition: unit.hpp:37
const Player & owner
The Player that owns and can control this Unit.
Definition: unit.hpp:74
const int & stun_immune
Duration of stun immunity. (0 to timeImmune).
Definition: unit.hpp:89
const int & blueium_ore
The amount of blueium ore carried by this unit. (0 to job carry capacity - other carried items)...
Definition: unit.hpp:54
const int & blueium
The amount of blueium carried by this unit. (0 to job carry capacity - other carried items)...
Definition: unit.hpp:49
An object in the game. The most basic class that all game classes should inherit from automatically...
Definition: game_object.hpp:37
bool pickup(const Tile &tile, int amount, const std::string &material)
picks up material at the units feet or adjacent tile.
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
Information about a unit's job.
Definition: job.hpp:37