C++ Joueur Client
 All Classes Namespaces Functions Variables
game_object.hpp
1 #ifndef GAMES_NECROWAR_GAME_OBJECT_H
2 #define GAMES_NECROWAR_GAME_OBJECT_H
3 
4 // GameObject
5 // An object in the game. The most basic class that all game classes should inherit from automatically.
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_object.hpp"
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 Game_object : public Base_object
38 {
39 public:
40 
44  const std::string& game_object_name;
45 
49  const std::string& id;
50 
54  const std::vector<std::string>& logs;
55 
56  // <<-- Creer-Merge: member variables -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
57  // You can add additional member variables here. None of them will be tracked or updated by the server.
58  // <<-- /Creer-Merge: member variables -->>
59 
60 
65  void log(const std::string& message);
66 
67 
68  // <<-- Creer-Merge: methods -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
69  // You can add additional methods here.
70  // <<-- /Creer-Merge: methods -->>
71 
72  ~Game_object_();
73 
74  // ####################
75  // Don't edit these!
76  // ####################
78  Game_object_(std::initializer_list<std::pair<std::string, Any&&>> init);
79  Game_object_() : Game_object_({}){}
80  virtual void resize(const std::string& name, std::size_t size) override;
81  virtual void change_vec_values(const std::string& name, std::vector<std::pair<std::size_t, Any>>& values) override;
82  virtual void remove_key(const std::string& name, Any& key) override;
83  virtual std::unique_ptr<Any> add_key_value(const std::string& name, Any& key, Any& value) override;
84  virtual bool is_map(const std::string& name) override;
85  virtual void rebind_by_name(Any* to_change, const std::string& member, std::shared_ptr<Base_object> ref) override;
86  virtual Base_game* get_game() override;
88  // ####################
89  // Don't edit these!
90  // ####################
91 };
92 
93 } // necrowar
94 
95 } // cpp_client
96 
97 #endif // GAMES_NECROWAR_GAME_OBJECT_H
const std::vector< std::string > & logs
Any strings logged will be stored here. Intended for debugging.
Definition: game_object.hpp:54
const std::string & game_object_name
String representing the top level Class that this game object is an instance of. Used for reflection ...
Definition: game_object.hpp:44
const std::string & id
A unique id for each instance of a GameObject or a sub class. Used for client and server communicatio...
Definition: game_object.hpp:49
void log(const std::string &message)
adds a message to this _game_object's logs. _intended for your own debugging purposes, as strings stored here are saved in the gamelog.
An object in the game. The most basic class that all game classes should inherit from automatically...
Definition: game_object.hpp:37
Definition: base_object.hpp:19