C++ Joueur Client
 All Classes Namespaces Functions Variables
game.hpp
1 #ifndef GAMES_COREMINER_GAME_H
2 #define GAMES_COREMINER_GAME_H
3 
4 // Game
5 // Mine resources to obtain more value than your opponent.
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 
21 #include "../../joueur/src/base_game.hpp"
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 
39 namespace coreminer
40 {
41 
45 class Game : public Base_game
46 {
47 public:
48 
52  const int& bomb_price;
53 
57  const int& bomb_size;
58 
62  const std::vector<Bomb>& bombs;
63 
68 
73 
77  const int& current_turn;
78 
82  const int& dirt_price;
83 
87  const int& fall_damage;
88 
92  const int& fall_weight_damage;
93 
97  const std::unordered_map<std::string, Game_object>& game_objects;
98 
102  const int& ladder_cost;
103 
107  const int& ladder_health;
108 
112  const int& large_cargo_size;
113 
118 
122  const int& map_height;
123 
127  const int& map_width;
128 
132  const int& max_shielding;
133 
137  const int& max_turns;
138 
142  const int& max_upgrade_level;
143 
147  const std::vector<Miner>& miners;
148 
152  const int& ore_price;
153 
157  const int& ore_value;
158 
162  const std::vector<Player>& players;
163 
167  const std::string& session;
168 
172  const int& shield_cost;
173 
177  const int& shield_health;
178 
182  const int& spawn_price;
183 
187  const int& suffocation_damage;
188 
193 
197  const int& support_cost;
198 
202  const int& support_health;
203 
207  const std::vector<Tile>& tiles;
208 
212  const double& time_added_per_turn;
213 
217  const int& upgrade_price;
218 
222  const std::vector<Upgrade>& upgrades;
223 
227  const int& victory_amount;
228 
229  // <<-- Creer-Merge: member variables -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
230  // You can add additional member variables here. None of them will be tracked or updated by the server.
231  // <<-- /Creer-Merge: member variables -->>
232 
233 
240  Tile get_tile_at(const int x, const int y);
241 
242  // <<-- Creer-Merge: methods -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
243  // You can add additional methods here.
244  // <<-- /Creer-Merge: methods -->>
245 
246  ~Game_();
247 
248  // ####################
249  // Don't edit these!
250  // ####################
252  Game_(std::initializer_list<std::pair<std::string, Any&&>> init);
253  Game_() : Game_({}){}
254  virtual void resize(const std::string& name, std::size_t size) override;
255  virtual void change_vec_values(const std::string& name, std::vector<std::pair<std::size_t, Any>>& values) override;
256  virtual void remove_key(const std::string& name, Any& key) override;
257  virtual std::unique_ptr<Any> add_key_value(const std::string& name, Any& key, Any& value) override;
258  virtual bool is_map(const std::string& name) override;
259  virtual void rebind_by_name(Any* to_change, const std::string& member, std::shared_ptr<Base_object> ref) override;
261  // ####################
262  // Don't edit these!
263  // ####################
264 };
265 
266 } // coreminer
267 
268 } // cpp_client
269 
270 #endif // GAMES_COREMINER_GAME_H
const std::vector< Miner > & miners
Every Miner in the game.
Definition: game.hpp:147
const int & ladder_health
The amount of mining power needed to remove a ladder from a Tile.
Definition: game.hpp:107
const int & upgrade_price
The cost to upgrade a Miner.
Definition: game.hpp:217
const int & current_turn
The current turn number, starting at 0 for the first player's turn.
Definition: game.hpp:77
const int & support_health
The amount of mining power needed to remove a support from a Tile.
Definition: game.hpp:202
const int & suffocation_damage
The amount of damage taken when suffocating inside a filled Tile.
Definition: game.hpp:187
const std::vector< Tile > & tiles
All the tiles in the map, stored in Row-major order. Use x + y * mapWidth to access the correct index...
Definition: game.hpp:207
const int & bomb_size
The amount of cargo space taken up by a Bomb.
Definition: game.hpp:57
const int & fall_weight_damage
The amount of extra damage taken for falling while carrying a large amount of cargo.
Definition: game.hpp:92
const int & bomb_price
The monetary price of a bomb when bought or sold.
Definition: game.hpp:52
const std::vector< Upgrade > & upgrades
Every Upgrade for a Miner in the game.
Definition: game.hpp:222
const int & building_material_price
The monetary price of building materials when bought.
Definition: game.hpp:67
const int & victory_amount
The amount of victory points (value) required to win.
Definition: game.hpp:227
const std::unordered_map< std::string, Game_object > & game_objects
A mapping of every game object's ID to the actual game object. Primarily used by the server and clien...
Definition: game.hpp:97
const int & map_width
The number of Tiles in the map along the x (horizontal) axis.
Definition: game.hpp:127
const int & support_cost
The amount of building material required to build a support.
Definition: game.hpp:197
const int & fall_damage
The amount of damage taken per Tile fallen.
Definition: game.hpp:87
const int & max_upgrade_level
The highest upgrade level allowed on a Miner.
Definition: game.hpp:142
const int & spawn_price
The monetary price of spawning a Miner.
Definition: game.hpp:182
const double & time_added_per_turn
The amount of time (in nano-seconds) added after each player performs a turn.
Definition: game.hpp:212
const std::vector< Bomb > & bombs
Every Bomb in the game.
Definition: game.hpp:62
const int & ore_price
The amount of money awarded when ore is dumped in the base and sold.
Definition: game.hpp:152
const int & ore_value
The amount of value awarded when ore is dumped in the base and sold.
Definition: game.hpp:157
const int & suffocation_weight_damage
The amount of extra damage taken for suffocating under a large amount of material.
Definition: game.hpp:192
const std::vector< Player > & players
List of all the players in the game.
Definition: game.hpp:162
A Tile in the game that makes up the 2D map grid.
Definition: tile.hpp:37
const int & shield_cost
The amount of building material required to shield a Tile.
Definition: game.hpp:172
const int & large_cargo_size
The amount deemed as a large amount of cargo.
Definition: game.hpp:112
const Player & current_player
The player whose turn it is currently. That player can send commands. Other players cannot...
Definition: game.hpp:72
Tile get_tile_at(const int x, const int y)
Gets the Tile at a specified (x, y) position
const int & shield_health
The amount of mining power needed to remove one unit of shielding off a Tile.
Definition: game.hpp:177
const int & ladder_cost
The amount of building material required to build a ladder.
Definition: game.hpp:102
const int & map_height
The number of Tiles in the map along the y (vertical) axis.
Definition: game.hpp:122
const int & max_shielding
The maximum amount of shielding possible on a Tile.
Definition: game.hpp:132
const int & large_material_size
The amount deemed as a large amount of material.
Definition: game.hpp:117
const std::string & session
A unique identifier for the game instance that is being played.
Definition: game.hpp:167
const int & dirt_price
The monetary price of dirt when bought or sold.
Definition: game.hpp:82
A player in this game. Every AI controls one player.
Definition: player.hpp:37
const int & max_turns
The maximum number of turns before the game will automatically end.
Definition: game.hpp:137
Mine resources to obtain more value than your opponent.
Definition: game.hpp:45