C++ Joueur Client
 All Classes Namespaces Functions Variables
spiderling.hpp
1 #ifndef GAMES_SPIDERS_SPIDERLING_H
2 #define GAMES_SPIDERS_SPIDERLING_H
3 
4 // Spiderling
5 // A Spider spawned by the BroodMother.
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 "spider.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 Spiderling : public Spider
38 {
39 public:
40 
44  const std::string& busy;
45 
50 
55 
59  const int& number_of_coworkers;
60 
64  const double& work_remaining;
65 
66  // <<-- Creer-Merge: member variables -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
67  // You can add additional member variables here. None of them will be tracked or updated by the server.
68  // <<-- /Creer-Merge: member variables -->>
69 
70 
75  bool attack(const Spiderling& spiderling);
76 
81  bool move(const Web& web);
82 
83 
84  // <<-- Creer-Merge: methods -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
85  // You can add additional methods here.
86  // <<-- /Creer-Merge: methods -->>
87 
88  ~Spiderling_();
89 
90  // ####################
91  // Don't edit these!
92  // ####################
94  Spiderling_(std::initializer_list<std::pair<std::string, Any&&>> init);
95  Spiderling_() : Spiderling_({}){}
96  virtual void resize(const std::string& name, std::size_t size) override;
97  virtual void change_vec_values(const std::string& name, std::vector<std::pair<std::size_t, Any>>& values) override;
98  virtual void remove_key(const std::string& name, Any& key) override;
99  virtual std::unique_ptr<Any> add_key_value(const std::string& name, Any& key, Any& value) override;
100  virtual bool is_map(const std::string& name) override;
101  virtual void rebind_by_name(Any* to_change, const std::string& member, std::shared_ptr<Base_object> ref) override;
103  // ####################
104  // Don't edit these!
105  // ####################
106 };
107 
108 } // spiders
109 
110 } // cpp_client
111 
112 #endif // GAMES_SPIDERS_SPIDERLING_H
const std::string & busy
When empty string this Spiderling is not busy, and can act. Otherwise a string representing what it i...
Definition: spiderling.hpp:44
const int & number_of_coworkers
The number of Spiderlings busy with the same work this Spiderling is doing, speeding up the task...
Definition: spiderling.hpp:59
const Web & moving_on_web
The Web this Spiderling is using to move. Null if it is not moving.
Definition: spiderling.hpp:49
A connection (edge) to a Nest (node) in the game that Spiders can converge on (regardless of owner)...
Definition: web.hpp:37
bool move(const Web &web)
starts moving the _spiderling across a _web to another _nest.
A Spider in the game. The most basic unit.
Definition: spider.hpp:37
const Nest & moving_to_nest
The Nest this Spiderling is moving to. Null if it is not moving.
Definition: spiderling.hpp:54
bool attack(const Spiderling &spiderling)
attacks another _spiderling.
const double & work_remaining
How much work needs to be done for this Spiderling to finish being busy. See docs for the Work formul...
Definition: spiderling.hpp:64
A location (node) connected to other Nests via Webs (edges) in the game that Spiders can converge on...
Definition: nest.hpp:37
A Spider spawned by the BroodMother.
Definition: spiderling.hpp:37