C++ Joueur Client
 All Classes Namespaces Functions Variables
player.hpp
1 #ifndef GAMES_COREMINER_PLAYER_H
2 #define GAMES_COREMINER_PLAYER_H
3 
4 // Player
5 // A player in this game. Every AI controls one player.
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/coreminer_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 coreminer
32 {
33 
37 class Player : public Game_object
38 {
39 public:
40 
44  const Tile& base_tile;
45 
49  const std::vector<Bomb>& bombs;
50 
54  const std::string& client_type;
55 
59  const std::vector<Tile>& hopper_tiles;
60 
64  const bool& lost;
65 
69  const std::vector<Miner>& miners;
70 
74  const int& money;
75 
79  const std::string& name;
80 
84  const Player& opponent;
85 
89  const std::string& reason_lost;
90 
94  const std::string& reason_won;
95 
99  const double& time_remaining;
100 
104  const int& value;
105 
109  const bool& won;
110 
111  // <<-- Creer-Merge: member variables -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
112  // You can add additional member variables here. None of them will be tracked or updated by the server.
113  // <<-- /Creer-Merge: member variables -->>
114 
115 
119  bool spawn_miner();
120 
121 
122  // <<-- Creer-Merge: methods -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
123  // You can add additional methods here.
124  // <<-- /Creer-Merge: methods -->>
125 
126  ~Player_();
127 
128  // ####################
129  // Don't edit these!
130  // ####################
132  Player_(std::initializer_list<std::pair<std::string, Any&&>> init);
133  Player_() : Player_({}){}
134  virtual void resize(const std::string& name, std::size_t size) override;
135  virtual void change_vec_values(const std::string& name, std::vector<std::pair<std::size_t, Any>>& values) override;
136  virtual void remove_key(const std::string& name, Any& key) override;
137  virtual std::unique_ptr<Any> add_key_value(const std::string& name, Any& key, Any& value) override;
138  virtual bool is_map(const std::string& name) override;
139  virtual void rebind_by_name(Any* to_change, const std::string& member, std::shared_ptr<Base_object> ref) override;
141  // ####################
142  // Don't edit these!
143  // ####################
144 };
145 
146 } // coreminer
147 
148 } // cpp_client
149 
150 #endif // GAMES_COREMINER_PLAYER_H
const Player & opponent
This player's opponent in the game.
Definition: player.hpp:84
const std::string & reason_lost
The reason why the player lost the game.
Definition: player.hpp:89
const std::string & client_type
What type of client this is, e.g. 'Python', 'JavaScript', or some other language. For potential data ...
Definition: player.hpp:54
const std::vector< Tile > & hopper_tiles
The Tiles this Player's hoppers are on.
Definition: player.hpp:59
const std::vector< Miner > & miners
Every Miner owned by this Player.
Definition: player.hpp:69
bool spawn_miner()
spawns a _miner on this _player's base _tile.
const int & value
The amount of value (victory points) this Player has gained.
Definition: player.hpp:104
const std::string & reason_won
The reason why the player won the game.
Definition: player.hpp:94
const double & time_remaining
The amount of time (in ns) remaining for this AI to send commands.
Definition: player.hpp:99
const bool & won
If the player won the game or not.
Definition: player.hpp:109
const bool & lost
If the player lost the game or not.
Definition: player.hpp:64
An object in the game. The most basic class that all game classes should inherit from automatically...
Definition: game_object.hpp:37
const int & money
The amount of money this Player currently has.
Definition: player.hpp:74
A Tile in the game that makes up the 2D map grid.
Definition: tile.hpp:37
const std::vector< Bomb > & bombs
Every Bomb owned by this Player.
Definition: player.hpp:49
const std::string & name
The name of the player.
Definition: player.hpp:79
A player in this game. Every AI controls one player.
Definition: player.hpp:37
const Tile & base_tile
The Tile this Player's base is on.
Definition: player.hpp:44