Debian Codegraph @

plugins/dm.stimresponse/SRPropertyLoader.h

raw
1 #pragma once
2
3 #include "ieclass.h"
4 #include "ientity.h"
5 #include "SREntity.h"
6 #include "StimTypes.h"
7
8 class SRPropertyLoader
9 {
10 private:
11 // The reference to the list of possible key names
12 SREntity::KeyList& _keys;
13
14 // The container hosting the StimResponse objects
15 SREntity& _srEntity;
16
17 // The target string for storing the parse warnings
18 std::string& _warnings;
19
20 // Local helper class containing all the stimtypes
21 StimTypes _stimTypes;
22
23 // spawnarg prefixes (as defined in the .game file)
24 std::string _prefix;
25 std::string _responseEffectPrefix;
26
27 public:
28 SRPropertyLoader(SREntity::KeyList& keys,
29 SREntity& srEntity,
30 std::string& warnings);
31
32 void visitKeyValue(const std::string& key, const std::string& value);
33
34 // operator() for IEntityClass::forEachEntityClass
35 void operator() (const EntityClassAttribute& attribute, bool);
36
37 private:
38 StimResponse& findOrCreate(int index, bool inherited);
39
40 /** greebo: Private helper method that does the attribute analysis
41 * and adds the SR items to the target list
42 *
43 * @inherited: reflects whether this key/value stems from a inheritance
44 */
45 void parseAttribute(const std::string& key,
46 const std::string& value,
47 bool inherited);
48
49 };