1 #ifndef GAMES_COREMINER_MINER_H
2 #define GAMES_COREMINER_MINER_H
14 #include <unordered_map>
16 #include <initializer_list>
18 #include "../../joueur/src/any.hpp"
20 #include "game_object.hpp"
22 #include "impl/coreminer_fwd.hpp"
113 bool buy(
const std::string& resource,
int amount);
121 bool dump(
const Tile&
tile,
const std::string& material,
int amount);
142 bool transfer(
const Miner& miner,
const std::string& resource,
int amount);
160 Miner_(std::initializer_list<std::pair<std::string, Any&&>> init);
161 Miner_() : Miner_({}){}
162 virtual void resize(
const std::string& name, std::size_t size)
override;
163 virtual void change_vec_values(
const std::string& name, std::vector<std::pair<std::size_t, Any>>& values)
override;
164 virtual void remove_key(
const std::string& name, Any& key)
override;
165 virtual std::unique_ptr<Any> add_key_value(
const std::string& name, Any& key, Any& value)
override;
166 virtual bool is_map(
const std::string& name)
override;
167 virtual void rebind_by_name(Any* to_change,
const std::string& member, std::shared_ptr<Base_object> ref)
override;
178 #endif // GAMES_COREMINER_MINER_H
const Player & owner
The Player that owns and can control this Miner.
Definition: miner.hpp:84
const int & upgrade_level
The upgrade level of this Miner. Starts at 0.
Definition: miner.hpp:94
bool dump(const Tile &tile, const std::string &material, int amount)
dumps materials from cargo to an adjacent _tile. _if the _tile is a base or a hopper _tile...
bool transfer(const Miner &miner, const std::string &resource, int amount)
transfers a resource from the one _miner to another.
const int & building_materials
The number of building materials carried by this Miner.
Definition: miner.hpp:49
bool mine(const Tile &tile, int amount)
mines the _tile the _miner is on or an adjacent _tile.
const Tile & tile
The Tile this Miner is on.
Definition: miner.hpp:89
bool upgrade()
upgrade this _miner by installing an upgrade module.
bool move(const Tile &tile)
moves this _miner from its current _tile to an adjacent _tile.
const Upgrade & current_upgrade
The Upgrade this Miner is on.
Definition: miner.hpp:54
const int & health
The remaining health of this Miner.
Definition: miner.hpp:64
bool buy(const std::string &resource, int amount)
purchase a resource from the _player's base or hopper.
Information about a Miner's Upgrade module.
Definition: upgrade.hpp:37
const int & moves
The number of moves this Miner has left this turn.
Definition: miner.hpp:74
A Miner in the game.
Definition: miner.hpp:37
An object in the game. The most basic class that all game classes should inherit from automatically...
Definition: game_object.hpp:37
A Tile in the game that makes up the 2D map grid.
Definition: tile.hpp:37
const int & ore
The amount of ore carried by this Miner.
Definition: miner.hpp:79
const int & bombs
The number of bombs being carried by this Miner.
Definition: miner.hpp:44
bool build(const Tile &tile, const std::string &type)
builds a support, shield, or ladder on _miner's _tile, or an adjacent _tile.
A player in this game. Every AI controls one player.
Definition: player.hpp:37
const int & dirt
The amount of dirt carried by this Miner.
Definition: miner.hpp:59
const int & mining_power
The remaining mining power this Miner has this turn.
Definition: miner.hpp:69