C++ Joueur Client
 All Classes Namespaces Functions Variables
game.hpp
1 #ifndef GAMES_SPIDERS_GAME_H
2 #define GAMES_SPIDERS_GAME_H
3 
4 // Game
5 // There's an infestation of enemy spiders challenging your queen BroodMother spider! Protect her and attack the other BroodMother in this turn based, node based, 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 
21 #include "../../joueur/src/base_game.hpp"
22 #include "impl/spiders_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 spiders
40 {
41 
45 class Game : public Base_game
46 {
47 public:
48 
53 
57  const int& current_turn;
58 
62  const int& cut_speed;
63 
67  const double& eggs_scalar;
68 
72  const std::unordered_map<std::string, Game_object>& game_objects;
73 
78 
82  const int& max_turns;
83 
87  const int& max_web_strength;
88 
92  const int& movement_speed;
93 
97  const std::vector<Nest>& nests;
98 
102  const std::vector<Player>& players;
103 
107  const std::string& session;
108 
112  const int& spit_speed;
113 
118 
122  const int& weave_power;
123 
127  const int& weave_speed;
128 
132  const std::vector<Web>& webs;
133 
134  // <<-- Creer-Merge: member variables -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
135  // You can add additional member variables here. None of them will be tracked or updated by the server.
136  // <<-- /Creer-Merge: member variables -->>
137 
138 
139 
140  // <<-- Creer-Merge: methods -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
141  // You can add additional methods here.
142  // <<-- /Creer-Merge: methods -->>
143 
144  ~Game_();
145 
146  // ####################
147  // Don't edit these!
148  // ####################
150  Game_(std::initializer_list<std::pair<std::string, Any&&>> init);
151  Game_() : Game_({}){}
152  virtual void resize(const std::string& name, std::size_t size) override;
153  virtual void change_vec_values(const std::string& name, std::vector<std::pair<std::size_t, Any>>& values) override;
154  virtual void remove_key(const std::string& name, Any& key) override;
155  virtual std::unique_ptr<Any> add_key_value(const std::string& name, Any& key, Any& value) override;
156  virtual bool is_map(const std::string& name) override;
157  virtual void rebind_by_name(Any* to_change, const std::string& member, std::shared_ptr<Base_object> ref) override;
159  // ####################
160  // Don't edit these!
161  // ####################
162 };
163 
164 } // spiders
165 
166 } // cpp_client
167 
168 #endif // GAMES_SPIDERS_GAME_H
const int & spit_speed
The speed at which Spitters work to spit new Webs.
Definition: game.hpp:112
const int & max_web_strength
The maximum strength a web can be strengthened to.
Definition: game.hpp:87
const int & time_added_per_turn
The amount of time (in nano-seconds) added after each player performs a turn.
Definition: game.hpp:117
A player in this game. Every AI controls one player.
Definition: player.hpp:37
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:72
const int & movement_speed
The speed at which Spiderlings move on Webs.
Definition: game.hpp:92
const int & weave_speed
The speed at which Weavers work to do strengthens and weakens on Webs.
Definition: game.hpp:127
const int & current_turn
The current turn number, starting at 0 for the first player's turn.
Definition: game.hpp:57
const int & cut_speed
The speed at which Cutters work to do cut Webs.
Definition: game.hpp:62
There's an infestation of enemy spiders challenging your queen BroodMother spider! Protect her and at...
Definition: game.hpp:45
const int & weave_power
How much web strength is added or removed from Webs when they are weaved.
Definition: game.hpp:122
const std::vector< Nest > & nests
Every Nest in the game.
Definition: game.hpp:97
const Player & current_player
The player whose turn it is currently. That player can send commands. Other players cannot...
Definition: game.hpp:52
const double & eggs_scalar
Constant used to calculate how many eggs BroodMothers get on their owner's turns. ...
Definition: game.hpp:67
const int & max_turns
The maximum number of turns before the game will automatically end.
Definition: game.hpp:82
const std::vector< Web > & webs
Every Web in the game.
Definition: game.hpp:132
const int & initial_web_strength
The starting strength for Webs.
Definition: game.hpp:77
const std::vector< Player > & players
List of all the players in the game.
Definition: game.hpp:102
const std::string & session
A unique identifier for the game instance that is being played.
Definition: game.hpp:107