C++ Joueur Client
 All Classes Namespaces Functions Variables
web.hpp
1 #ifndef GAMES_SPIDERS_WEB_H
2 #define GAMES_SPIDERS_WEB_H
3 
4 // Web
5 // A connection (edge) to a Nest (node) in the game that Spiders can converge on (regardless of owner). Spiders can travel in either direction on Webs.
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/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 
31 namespace spiders
32 {
33 
37 class Web : public Game_object
38 {
39 public:
40 
44  const double& length;
45 
49  const int& load;
50 
54  const Nest& nest_a;
55 
59  const Nest& nest_b;
60 
64  const std::vector<Spiderling>& spiderlings;
65 
69  const int& strength;
70 
71  // <<-- Creer-Merge: member variables -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
72  // You can add additional member variables here. None of them will be tracked or updated by the server.
73  // <<-- /Creer-Merge: member variables -->>
74 
75 
76 
77  // <<-- Creer-Merge: methods -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
78  // You can add additional methods here.
79  // <<-- /Creer-Merge: methods -->>
80 
81  ~Web_();
82 
83  // ####################
84  // Don't edit these!
85  // ####################
87  Web_(std::initializer_list<std::pair<std::string, Any&&>> init);
88  Web_() : Web_({}){}
89  virtual void resize(const std::string& name, std::size_t size) override;
90  virtual void change_vec_values(const std::string& name, std::vector<std::pair<std::size_t, Any>>& values) override;
91  virtual void remove_key(const std::string& name, Any& key) override;
92  virtual std::unique_ptr<Any> add_key_value(const std::string& name, Any& key, Any& value) override;
93  virtual bool is_map(const std::string& name) override;
94  virtual void rebind_by_name(Any* to_change, const std::string& member, std::shared_ptr<Base_object> ref) override;
96  // ####################
97  // Don't edit these!
98  // ####################
99 };
100 
101 } // spiders
102 
103 } // cpp_client
104 
105 #endif // GAMES_SPIDERS_WEB_H
const int & strength
How much weight this Web can take before snapping and destroying itself and all the Spiders on it...
Definition: web.hpp:69
const Nest & nest_b
The second Nest this Web is connected to.
Definition: web.hpp:59
A connection (edge) to a Nest (node) in the game that Spiders can converge on (regardless of owner)...
Definition: web.hpp:37
const std::vector< Spiderling > & spiderlings
All the Spiderlings currently moving along this Web.
Definition: web.hpp:64
const Nest & nest_a
The first Nest this Web is connected to.
Definition: web.hpp:54
const double & length
How long this Web is, i.e., the distance between its nestA and nestB.
Definition: web.hpp:44
const int & load
How much weight this Web currently has on it, which is the sum of all its Spiderlings weight...
Definition: web.hpp:49
A location (node) connected to other Nests via Webs (edges) in the game that Spiders can converge on...
Definition: nest.hpp:37
An object in the game. The most basic class that all game classes should inherit from automatically...
Definition: game_object.hpp:37