Plasma Engine  2.0
Loading...
Searching...
No Matches
StateMap.h
1#pragma once
2
3#include <Core/CoreDLL.h>
4#include <Foundation/Containers/HashTable.h>
5#include <Foundation/Strings/HashedString.h>
6
9class PL_CORE_DLL plStateMap
10{
11public:
12 plStateMap();
14
18
19 void Clear();
20
21 void StoreBool(const plTempHashedString& sName, bool value);
22 void StoreInteger(const plTempHashedString& sName, plInt64 value);
23 void StoreDouble(const plTempHashedString& sName, double value);
24 void StoreVec3(const plTempHashedString& sName, const plVec3& value);
25 void StoreColor(const plTempHashedString& sName, const plColor& value);
26 void StoreString(const plTempHashedString& sName, const plString& value);
27
28 void RetrieveBool(const plTempHashedString& sName, bool& out_bValue, bool bDefaultValue = false);
29 void RetrieveInteger(const plTempHashedString& sName, plInt64& out_iValue, plInt64 iDefaultValue = 0);
30 void RetrieveDouble(const plTempHashedString& sName, double& out_fValue, double fDefaultValue = 0);
31 void RetrieveVec3(const plTempHashedString& sName, plVec3& out_vValue, plVec3 vDefaultValue = plVec3(0));
32 void RetrieveColor(const plTempHashedString& sName, plColor& out_value, plColor defaultValue = plColor::White);
33 void RetrieveString(const plTempHashedString& sName, plString& out_sValue, plStringView sDefaultValue = {});
34
35private:
42};
plColor represents an RGBA color in linear color space. Values are stored as float,...
Definition Color.h:44
static const plColor White
#FFFFFF
Definition Color.h:194
Definition HashTable.h:333
A simple registry that stores name/value pairs of types that are common to store game state.
Definition StateMap.h:10
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
A class to use together with plHashedString for quick comparisons with temporary strings that need no...
Definition HashedString.h:151