Debian Codegraph @

plugins/dm.stimresponse/ResponseEffectTypes.h

raw
1 #pragma once
2
3 #include <map>
4 #include <string>
5 #include "ieclass.h"
6
7 namespace
8 {
9 const char* const GKEY_RESPONSE_EFFECT_PREFIX = "/stimResponseSystem/responseEffectPrefix";
10 }
11
12 typedef std::map<std::string, IEntityClassPtr> ResponseEffectTypeMap;
13
14 class ResponseEffectTypes
15 {
16 // The actual map where all the name => EClassPtr associations are stored.
17 ResponseEffectTypeMap _effectTypes;
18
19 ResponseEffectTypes();
20
21 static std::shared_ptr<ResponseEffectTypes>& InstancePtr();
22
23 public:
24 // Contains the static instance of this class
25 static ResponseEffectTypes& Instance();
26
27 // Frees the static instance of this class
28 // Any calls to Instance() after this call will instantiate a new singleton
29 static void Clear();
30
31 /** greebo: Returns the entityclass pointer for the given name.
32 */
33 IEntityClassPtr getEClassForName(const std::string& name);
34
35 /** greebo: Returns a reference to the internally stored EffectTypeMap
36 */
37 ResponseEffectTypeMap& getMap();
38
39 /** greebo: Retrieves the first available effect name (e.g. "effect_teleport")
40 */
41 std::string getFirstEffectName();
42 };