45 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*!
 | |
|  *
 | |
|  * @file    configManagement.h
 | |
|  * @author  RUBINI Thomas
 | |
|  * @author 	SIMAILA Djalim
 | |
|  * @date    January 2022
 | |
|  * @version 1.0
 | |
|  * @brief   config parser
 | |
|  *
 | |
|  */
 | |
| 
 | |
| #ifndef SPACE_CONFIGMANAGEMENT_H
 | |
| #define SPACE_CONFIGMANAGEMENT_H
 | |
| 
 | |
| #include<climits>
 | |
| 
 | |
| /* This header will only be imported once, but Djalim told me he would hurt me
 | |
|  * if I didn't move it into his own header file instead of the cpp file*/
 | |
| 
 | |
| class ConfigBuilder{
 | |
| public:
 | |
| 	ConfigData collectedData;
 | |
| 	void parseFile(const string& fname);
 | |
| 	void readConfig();
 | |
| 	void dumpInternalValues() const;
 | |
| private:
 | |
| 	map<string, string> internalValues;
 | |
| 
 | |
| 	const string& getString(const configKey& key, const string& def) const;
 | |
| 	const string& getString(const configKey& key) const;
 | |
| 	char getChar(const configKey& key, char def) const;
 | |
| 	char getChar(const configKey& key) const;
 | |
| 	int getInt(const configKey& key, int def, int min=INT_MIN, int max=INT_MAX) const;
 | |
| 	int getInt(const configKey& key) const;
 | |
| 	void getColor(const configKey& key, nsGraphics::RGBAcolor& color, const nsGraphics::RGBAcolor& def) const;
 | |
| 	void getColor(const configKey& key, nsGraphics::RGBAcolor& color) const;
 | |
| 	void getList(const configKey& key, vector<string>& vec) const;
 | |
| 
 | |
| 	void readGrid(const configKey& baseKey);
 | |
| 	void readPlayer(const configKey& baseKey, PlayerDef&);
 | |
| 	void readInvaderType(const configKey& baseKey, InvaderTypeDef&);
 | |
| };
 | |
| 
 | |
| #endif
 |