C++ Joueur Client
 All Classes Namespaces Functions Variables
tower.hpp
1 #ifndef GAMES_NECROWAR_TOWER_H
2 #define GAMES_NECROWAR_TOWER_H
3 
4 // Tower
5 // A tower in the game. Used to combat enemy waves.
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/necrowar_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 necrowar
32 {
33 
37 class Tower : public Game_object
38 {
39 public:
40 
44  const bool& attacked;
45 
49  const int& cooldown;
50 
54  const int& health;
55 
59  const Tower_job& job;
60 
64  const Player& owner;
65 
69  const Tile& tile;
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 
80  bool attack(const Tile& tile);
81 
82 
83  // <<-- Creer-Merge: methods -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
84  // You can add additional methods here.
85  // <<-- /Creer-Merge: methods -->>
86 
87  ~Tower_();
88 
89  // ####################
90  // Don't edit these!
91  // ####################
93  Tower_(std::initializer_list<std::pair<std::string, Any&&>> init);
94  Tower_() : Tower_({}){}
95  virtual void resize(const std::string& name, std::size_t size) override;
96  virtual void change_vec_values(const std::string& name, std::vector<std::pair<std::size_t, Any>>& values) override;
97  virtual void remove_key(const std::string& name, Any& key) override;
98  virtual std::unique_ptr<Any> add_key_value(const std::string& name, Any& key, Any& value) override;
99  virtual bool is_map(const std::string& name) override;
100  virtual void rebind_by_name(Any* to_change, const std::string& member, std::shared_ptr<Base_object> ref) override;
102  // ####################
103  // Don't edit these!
104  // ####################
105 };
106 
107 } // necrowar
108 
109 } // cpp_client
110 
111 #endif // GAMES_NECROWAR_TOWER_H
const Player & owner
The player that built / owns this tower.
Definition: tower.hpp:64
A Tile in the game that makes up the 2D map grid.
Definition: tile.hpp:37
Information about a tower's job/type.
Definition: tower_job.hpp:37
An object in the game. The most basic class that all game classes should inherit from automatically...
Definition: game_object.hpp:37
const int & cooldown
How many turns are left before it can fire again.
Definition: tower.hpp:49
A player in this game. Every AI controls one player.
Definition: player.hpp:37
const Tower_job & job
What type of tower this is (it's job).
Definition: tower.hpp:59
A tower in the game. Used to combat enemy waves.
Definition: tower.hpp:37
bool attack(const Tile &tile)
attacks an enemy unit on an tile within it's range.
const bool & attacked
Whether this tower has attacked this turn or not.
Definition: tower.hpp:44
const Tile & tile
The Tile this Tower is on.
Definition: tower.hpp:69
const int & health
How much remaining health this tower has.
Definition: tower.hpp:54