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