1 #ifndef GAMES_STUMPED_BEAVER_H
2 #define GAMES_STUMPED_BEAVER_H
14 #include <unordered_map>
16 #include <initializer_list>
18 #include "../../joueur/src/any.hpp"
20 #include "game_object.hpp"
22 #include "impl/stumped_fwd.hpp"
113 bool drop(
const Tile&
tile,
const std::string& resource,
int amount = 0);
133 bool pickup(
const Tile&
tile,
const std::string& resource,
int amount = 0);
146 Beaver_(std::initializer_list<std::pair<std::string, Any&&>> init);
147 Beaver_() : Beaver_({}){}
148 virtual void resize(
const std::string& name, std::size_t size)
override;
149 virtual void change_vec_values(
const std::string& name, std::vector<std::pair<std::size_t, Any>>& values)
override;
150 virtual void remove_key(
const std::string& name, Any& key)
override;
151 virtual std::unique_ptr<Any> add_key_value(
const std::string& name, Any& key, Any& value)
override;
152 virtual bool is_map(
const std::string& name)
override;
153 virtual void rebind_by_name(Any* to_change,
const std::string& member, std::shared_ptr<Base_object> ref)
override;
164 #endif // GAMES_STUMPED_BEAVER_H
const int & health
How much health this Beaver has left.
Definition: beaver.hpp:59
Information about a beaver's job.
Definition: job.hpp:37
const bool & recruited
True if the Beaver has finished being recruited and can do things, False otherwise.
Definition: beaver.hpp:79
const int & moves
How many moves this Beaver has left this turn.
Definition: beaver.hpp:69
bool pickup(const Tile &tile, const std::string &resource, int amount=0)
picks up some branches or food on the beaver's tile.
bool drop(const Tile &tile, const std::string &resource, int amount=0)
drops some of the given resource on the beaver's _tile.
const int & turns_distracted
Number of turns this Beaver is distracted for (0 means not distracted).
Definition: beaver.hpp:89
bool harvest(const Spawner &spawner)
harvests the branches or food from a _spawner on an adjacent _tile.
A player in this game. Every AI controls one player.
Definition: player.hpp:37
A Tile in the game that makes up the 2D map grid.
Definition: tile.hpp:37
bool attack(const Beaver &beaver)
attacks another adjacent beaver.
A beaver in the game.
Definition: beaver.hpp:37
const int & branches
The amount of branches this Beaver is holding.
Definition: beaver.hpp:49
const Job & job
The Job this Beaver was recruited to do.
Definition: beaver.hpp:64
const Tile & tile
The Tile this Beaver is on.
Definition: beaver.hpp:84
bool move(const Tile &tile)
moves this _beaver from its current _tile to an adjacent _tile.
const Player & owner
The Player that owns and can control this Beaver.
Definition: beaver.hpp:74
An object in the game. The most basic class that all game classes should inherit from automatically...
Definition: game_object.hpp:37
A resource spawner that generates branches or food.
Definition: spawner.hpp:37
bool build_lodge()
builds a lodge on the _beavers current _tile.
const int & food
The amount of food this Beaver is holding.
Definition: beaver.hpp:54
const int & actions
The number of actions remaining for the Beaver this turn.
Definition: beaver.hpp:44