1 #ifndef GAMES_STARDASH_UNIT_H
2 #define GAMES_STARDASH_UNIT_H
14 #include <unordered_map>
16 #include <initializer_list>
18 #include "../../joueur/src/any.hpp"
20 #include "game_object.hpp"
22 #include "impl/stardash_fwd.hpp"
137 bool dash(
const double&
x,
const double&
y);
150 bool move(
const double&
x,
const double&
y);
157 bool safe(
const double&
x,
const double&
y);
171 bool transfer(
const Unit& unit,
int amount,
const std::string& material);
184 Unit_(std::initializer_list<std::pair<std::string, Any&&>> init);
185 Unit_() : Unit_({}){}
186 virtual void resize(
const std::string& name, std::size_t size)
override;
187 virtual void change_vec_values(
const std::string& name, std::vector<std::pair<std::size_t, Any>>& values)
override;
188 virtual void remove_key(
const std::string& name, Any& key)
override;
189 virtual std::unique_ptr<Any> add_key_value(
const std::string& name, Any& key, Any& value)
override;
190 virtual bool is_map(
const std::string& name)
override;
191 virtual void rebind_by_name(Any* to_change,
const std::string& member, std::shared_ptr<Base_object> ref)
override;
202 #endif // GAMES_STARDASH_UNIT_H
const int & mythicite
The amount of Mythicite carried by this unit. (0 to job carry capacity - other carried items)...
Definition: unit.hpp:89
const Player & owner
The Player that owns and can control this Unit.
Definition: unit.hpp:94
bool dash(const double &x, const double &y)
causes the unit to dash towards the designated destination.
Tracks any projectiles moving through space.
Definition: projectile.hpp:37
bool move(const double &x, const double &y)
moves this _unit from its current location to the new location specified.
const int & genarium
The amount of Genarium ore carried by this unit. (0 to job carry capacity - other carried items)...
Definition: unit.hpp:64
A player in this game. Every AI controls one player.
Definition: player.hpp:37
const int & legendarium
The amount of Legendarium ore carried by this unit. (0 to job carry capacity - other carried items)...
Definition: unit.hpp:79
Information about a unit's job.
Definition: job.hpp:37
bool transfer(const Unit &unit, int amount, const std::string &material)
grab materials from a friendly unit. _doesn't use a action.
const double & moves
The distance this unit can still move.
Definition: unit.hpp:84
const double & x
The x value this unit is on.
Definition: unit.hpp:114
A unit in the game. May be a corvette, missleboat, martyr, transport, miner.
Definition: unit.hpp:37
bool mine(const Body &body)
allows a miner to mine a asteroid.
bool attack(const Unit &enemy)
attacks the specified unit.
const double & y
The y value this unit is on.
Definition: unit.hpp:119
bool shootdown(const Projectile &missile)
attacks the specified projectile.
const double & dash_x
The x value this unit is dashing to.
Definition: unit.hpp:49
const int & shield
The shield that a martyr ship has.
Definition: unit.hpp:109
const bool & acted
Whether or not this Unit has performed its action this turn.
Definition: unit.hpp:44
const bool & is_busy
Tracks whether or not the ship is dashing or Mining. If true, it cannot do anything else...
Definition: unit.hpp:69
An object in the game. The most basic class that all game classes should inherit from automatically...
Definition: game_object.hpp:37
const Unit & protector
The martyr ship that is currently shielding this ship if any.
Definition: unit.hpp:99
const int & rarium
The amount of Rarium carried by this unit. (0 to job carry capacity - other carried items)...
Definition: unit.hpp:104
const Job & job
The Job this Unit has.
Definition: unit.hpp:74
A celestial body located within the game.
Definition: body.hpp:37
bool safe(const double &x, const double &y)
tells you if your ship can move to that location from were it is without clipping the sun...
const double & dash_y
The y value this unit is dashing to.
Definition: unit.hpp:54
const int & energy
The remaining health of the unit.
Definition: unit.hpp:59