1 #ifndef GAMES_SALOON_GAME_OBJECT_H 
    2 #define GAMES_SALOON_GAME_OBJECT_H 
   14 #include <unordered_map> 
   16 #include <initializer_list> 
   18 #include "../../joueur/src/any.hpp" 
   21 #include "../../joueur/src/base_object.hpp" 
   22 #include "impl/saloon_fwd.hpp" 
   49     const std::string& 
id;
 
   54     const std::vector<std::string>& 
logs;
 
   65     void log(
const std::string& message);
 
   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;
 
   97 #endif // GAMES_SALOON_GAME_OBJECT_H 
An object in the game. The most basic class that all game classes should inherit from automatically...
Definition: game_object.hpp:37
 
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. 
 
Definition: base_object.hpp:19
 
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