Thrive
player_data.h
1 #pragma once
2 
3 #include "engine/typedefs.h"
4 
5 #include <string>
6 #include <memory>
7 
8 namespace luabind {
9  class scope;
10 }
11 
12 namespace thrive {
13 
14 class GameState;
15 class StorageContainer;
16 class LockedMap;
17 
18 class PlayerData {
19 
20 public:
21 
28  PlayerData(
29  std::string name
30  );
31 
35  ~PlayerData();
36 
51  static luabind::scope
52  luaBindings();
53 
59  const std::string&
60  playerName();
61 
67  LockedMap&
68  lockedMap();
69 
75  EntityId
77 
87  void
89  EntityId creatureId,
90  GameState& gamestate
91  );
92 
98  GameState&
100 
106  bool
107  isBoolSet(
108  std::string key
109  ) const ;
110 
120  void
121  setBool(
122  std::string key,
123  bool value
124  );
125 
133  void
134  load(
136  );
137 
146  storage() const;
147 
148 private:
149 
150  struct Implementation;
151  std::unique_ptr<Implementation> m_impl;
152 
153 };
154 
155 
156 }
void setBool(std::string key, bool value)
Binds a string to a bool.
Definition: player_data.cpp:92
void setActiveCreature(EntityId creatureId, GameState &gamestate)
setter for the players active creature
Definition: player_data.cpp:71
const std::string & playerName()
Getter for the players name.
Definition: player_data.cpp:56
static luabind::scope luaBindings()
Lua bindings.
Definition: player_data.cpp:33
Object that contains a set of locked concepts represented and accessed by strings.
Definition: locked_map.h:23
EntityId activeCreature()
Getter for the id of the players currently active creature entity.
Definition: player_data.cpp:66
PlayerData(std::string name)
constructor
Definition: player_data.cpp:47
StorageContainer storage() const
Called by the engine during savegame creation.
Definition: player_data.cpp:121
Definition: player_data.h:18
Definition: bullet_to_ogre_system.h:5
Definition: bullet_ogre_conversion.h:6
void load(const StorageContainer &storage)
Called by the engine during loading of a savegame.
Definition: player_data.cpp:105
~PlayerData()
destructor
Definition: player_data.cpp:53
GameState & activeCreatureGamestate()
Getter for the players currently active creatures gamestate.
Definition: player_data.cpp:80
Represents a distinct set of active systems and entities.
Definition: game_state.h:41
bool isBoolSet(std::string key) const
Returns whether a key has a true bool set to it.
Definition: player_data.cpp:85
A key-value storage for serialization.
Definition: serialization.h:36
LockedMap & lockedMap()
Getter for the map of locked concepts.
Definition: player_data.cpp:61