C++ Joueur Client
 All Classes Namespaces Functions Variables
game.hpp
1 #ifndef GAMES_STARDASH_GAME_H
2 #define GAMES_STARDASH_GAME_H
3 
4 // Game
5 // Collect of the most of the rarest mineral orbiting around the sun and out-compete your competitor.
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/stardash_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 stardash
40 {
41 
45 class Game : public Base_game
46 {
47 public:
48 
52  const std::vector<Body>& bodies;
53 
58 
62  const int& current_turn;
63 
67  const int& dash_cost;
68 
72  const int& dash_distance;
73 
77  const std::unordered_map<std::string, Game_object>& game_objects;
78 
82  const double& genarium_value;
83 
87  const std::vector<Job>& jobs;
88 
92  const double& legendarium_value;
93 
97  const int& max_asteroid;
98 
102  const int& max_turns;
103 
107  const int& min_asteroid;
108 
112  const int& mining_speed;
113 
117  const double& mythicite_amount;
118 
122  const int& orbits_protected;
123 
127  const double& ore_rarity_genarium;
128 
132  const double& ore_rarity_legendarium;
133 
137  const double& ore_rarity_rarium;
138 
142  const int& planet_energy_cap;
143 
148 
152  const std::vector<Player>& players;
153 
157  const int& projectile_radius;
158 
162  const int& projectile_speed;
163 
167  const std::vector<Projectile>& projectiles;
168 
172  const double& rarium_value;
173 
177  const double& regenerate_rate;
178 
182  const std::string& session;
183 
187  const int& ship_radius;
188 
192  const int& size_x;
193 
197  const int& size_y;
198 
203 
207  const int& turns_to_orbit;
208 
212  const std::vector<Unit>& units;
213 
214  // <<-- Creer-Merge: member variables -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
215  // You can add additional member variables here. None of them will be tracked or updated by the server.
216  // <<-- /Creer-Merge: member variables -->>
217 
218 
219 
220  // <<-- Creer-Merge: methods -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
221  // You can add additional methods here.
222  // <<-- /Creer-Merge: methods -->>
223 
224  ~Game_();
225 
226  // ####################
227  // Don't edit these!
228  // ####################
230  Game_(std::initializer_list<std::pair<std::string, Any&&>> init);
231  Game_() : Game_({}){}
232  virtual void resize(const std::string& name, std::size_t size) override;
233  virtual void change_vec_values(const std::string& name, std::vector<std::pair<std::size_t, Any>>& values) override;
234  virtual void remove_key(const std::string& name, Any& key) override;
235  virtual std::unique_ptr<Any> add_key_value(const std::string& name, Any& key, Any& value) override;
236  virtual bool is_map(const std::string& name) override;
237  virtual void rebind_by_name(Any* to_change, const std::string& member, std::shared_ptr<Base_object> ref) override;
239  // ####################
240  // Don't edit these!
241  // ####################
242 };
243 
244 } // stardash
245 
246 } // cpp_client
247 
248 #endif // GAMES_STARDASH_GAME_H
const int & current_turn
The current turn number, starting at 0 for the first player's turn.
Definition: game.hpp:62
Collect of the most of the rarest mineral orbiting around the sun and out-compete your competitor...
Definition: game.hpp:45
const std::vector< Projectile > & projectiles
Every projectile in the game.
Definition: game.hpp:167
const int & time_added_per_turn
The amount of time (in nano-seconds) added after each player performs a turn.
Definition: game.hpp:202
const int & planet_energy_cap
The amount of energy a planet can hold at once.
Definition: game.hpp:142
const std::vector< Player > & players
List of all the players in the game.
Definition: game.hpp:152
A player in this game. Every AI controls one player.
Definition: player.hpp:37
const int & turns_to_orbit
The number of turns it takes for a asteroid to orbit the sun. (Asteroids move after each players turn...
Definition: game.hpp:207
const int & max_turns
The maximum number of turns before the game will automatically end.
Definition: game.hpp:102
const std::vector< Unit > & units
Every Unit in the game.
Definition: game.hpp:212
const double & ore_rarity_genarium
The rarity modifier of the most common ore. This controls how much spawns.
Definition: game.hpp:127
const double & regenerate_rate
The regeneration rate of asteroids.
Definition: game.hpp:177
const int & dash_cost
The cost of dashing.
Definition: game.hpp:67
const double & legendarium_value
The value of every unit of legendarium.
Definition: game.hpp:92
const int & max_asteroid
The highest amount of material, that can be in a asteroid.
Definition: game.hpp:97
const int & size_x
The size of the map in the X direction.
Definition: game.hpp:192
const Player & current_player
The player whose turn it is currently. That player can send commands. Other players cannot...
Definition: game.hpp:57
const int & planet_recharge_rate
The amount of energy the planets restore each round.
Definition: game.hpp:147
const double & genarium_value
The value of every unit of genarium.
Definition: game.hpp:82
const std::vector< Job > & jobs
A list of all jobs. The first element is corvette, second is missileboat, third is martyr...
Definition: game.hpp:87
const int & mining_speed
The rate at which miners grab minerals from asteroids.
Definition: game.hpp:112
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:77
const double & mythicite_amount
The amount of mythicite that spawns at the start of the game.
Definition: game.hpp:117
const std::string & session
A unique identifier for the game instance that is being played.
Definition: game.hpp:182
const double & rarium_value
The value of every unit of rarium.
Definition: game.hpp:172
const std::vector< Body > & bodies
All the celestial bodies in the game. The first two are planets and the third is the sun...
Definition: game.hpp:52
const int & projectile_speed
The amount of distance missiles travel through space.
Definition: game.hpp:162
const int & projectile_radius
The standard size of ships.
Definition: game.hpp:157
const int & dash_distance
The distance traveled each turn by dashing.
Definition: game.hpp:72
const double & ore_rarity_rarium
The rarity modifier of the second rarest ore. This controls how much spawns.
Definition: game.hpp:137
const int & min_asteroid
The smallest amount of material, that can be in a asteroid.
Definition: game.hpp:107
const int & orbits_protected
The number of orbit updates you cannot mine the mithicite asteroid.
Definition: game.hpp:122
const int & ship_radius
The standard size of ships.
Definition: game.hpp:187
const int & size_y
The size of the map in the Y direction.
Definition: game.hpp:197
const double & ore_rarity_legendarium
The rarity modifier of the rarest ore. This controls how much spawns.
Definition: game.hpp:132