C++ Joueur Client
 All Classes Namespaces Functions Variables
beaver.hpp
1 #ifndef GAMES_STUMPED_BEAVER_H
2 #define GAMES_STUMPED_BEAVER_H
3 
4 // Beaver
5 // A beaver in the game.
6 
7 // DO NOT MODIFY THIS FILE
8 // Never try to directly create an instance of this class, or modify its member variables.
9 // Instead, you should only be reading its variables and calling its functions.
10 
11 #include <vector>
12 #include <queue>
13 #include <deque>
14 #include <unordered_map>
15 #include <string>
16 #include <initializer_list>
17 
18 #include "../../joueur/src/any.hpp"
19 
20 #include "game_object.hpp"
21 
22 #include "impl/stumped_fwd.hpp"
23 
24 // <<-- Creer-Merge: includes -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
25 // you can add additional #includes here
26 // <<-- /Creer-Merge: includes -->>
27 
28 namespace cpp_client
29 {
30 
31 namespace stumped
32 {
33 
37 class Beaver : public Game_object
38 {
39 public:
40 
44  const int& actions;
45 
49  const int& branches;
50 
54  const int& food;
55 
59  const int& health;
60 
64  const Job& job;
65 
69  const int& moves;
70 
74  const Player& owner;
75 
79  const bool& recruited;
80 
84  const Tile& tile;
85 
89  const int& turns_distracted;
90 
91  // <<-- Creer-Merge: member variables -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
92  // You can add additional member variables here. None of them will be tracked or updated by the server.
93  // <<-- /Creer-Merge: member variables -->>
94 
95 
100  bool attack(const Beaver& beaver);
101 
105  bool build_lodge();
106 
113  bool drop(const Tile& tile, const std::string& resource, int amount = 0);
114 
119  bool harvest(const Spawner& spawner);
120 
125  bool move(const Tile& tile);
126 
133  bool pickup(const Tile& tile, const std::string& resource, int amount = 0);
134 
135 
136  // <<-- Creer-Merge: methods -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
137  // You can add additional methods here.
138  // <<-- /Creer-Merge: methods -->>
139 
140  ~Beaver_();
141 
142  // ####################
143  // Don't edit these!
144  // ####################
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;
155  // ####################
156  // Don't edit these!
157  // ####################
158 };
159 
160 } // stumped
161 
162 } // cpp_client
163 
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