SUPER Space invader : Turbo edition DX - VS GOD 1.0.0
A simple space invader ripoff
configManagement.h
Go to the documentation of this file.
1
12#ifndef SPACE_CONFIGMANAGEMENT_H
13#define SPACE_CONFIGMANAGEMENT_H
14
15#include<climits>
16
17/* This header will only be imported once, but Djalim told me he would hurt me
18 * if I didn't move it into his own header file instead of the cpp file*/
19
25public:
26
31
37 void parseFile(const string& fname);
38
44 void readConfig();
45
49 void dumpInternalValues() const;
50private:
54 map<string, string> internalValues;
55
62 const string& getString(const configKey& key, const string& def) const;
63
69 const string& getString(const configKey& key) const;
70
77 char getChar(const configKey& key, char def) const;
78
84 char getChar(const configKey& key) const;
85
94 int getInt(const configKey& key, int def, int min=INT_MIN, int max=INT_MAX) const;
95
101 int getInt(const configKey& key) const;
102
110 void getColor(const configKey& key, nsGraphics::RGBAcolor& color, const nsGraphics::RGBAcolor& def) const;
111
118 void getColor(const configKey& key, nsGraphics::RGBAcolor& color) const;
119
126 void getList(const configKey& baseKey, vector<string>& vec) const;
127
128
134 void readGrid(const configKey& baseKey);
135
142 void readPlayer(const configKey& baseKey, PlayerDef& def);
143
150 void readInvaderType(const configKey& baseKey, InvaderTypeDef& def);
151};
152
153#endif
temporary class used to populate a ConfigData object
void parseFile(const string &fname)
parse the file given, and put the keys/values in internalValues
ConfigData collectedData
Actual config data object.
void dumpInternalValues() const
print internalValues pairs in the console (in case in error reporting)
string configKey
Definition: configData.h:20
this struct stores all relevant data from the configuration file
Definition: configData.h:27
defines an invader type
Definition: invaderDef.h:21
player data, contains colors and key configuration
Definition: playerDef.h:42