46 lines
865 B
C++
46 lines
865 B
C++
#ifndef GUARD_CONFIG_H
|
|
#define GUARD_CONFIG_H
|
|
|
|
#include<vector>
|
|
#include<map>
|
|
#include<string>
|
|
#include "utils.h"
|
|
#include "player_def.h"
|
|
|
|
using namespace std;
|
|
|
|
typedef string configKey;
|
|
|
|
class Config{
|
|
public:
|
|
aliensGrid grid;
|
|
|
|
unsigned invadersSize;
|
|
unsigned invadersDistance;
|
|
|
|
unsigned missilesWidth;
|
|
unsigned missilesLength; // auto defined from width
|
|
unsigned torpedosWidth;
|
|
unsigned torpedosLength; // auto defined from width
|
|
unsigned playersWidth;
|
|
|
|
unsigned invadersSpeed;
|
|
unsigned playersSpeed;
|
|
|
|
PlayerDef p1Def;
|
|
PlayerDef p2Def;
|
|
unsigned startXPosition;
|
|
|
|
bool reloadConfig();
|
|
string* getString(const configKey& key);
|
|
char getChar(const configKey& key);
|
|
int getInt(const configKey& key);
|
|
nsGraphics::RGBAcolor getColor(const configKey& key);
|
|
|
|
private:
|
|
map<string, string> internalValues;
|
|
bool parseConfig();
|
|
bool loadConfig();
|
|
};
|
|
|
|
#endif |