www.pudn.com > ICE_1.4.zip > ICE_options.h


// Class automatically generated by Dev-C++ New Class wizard 
 
#ifndef ICE_OPTIONS_H 
#define ICE_OPTIONS_H 
 
//TODO: replace with tinyXML 
#include "../Utility/q_XML.h"  //used to save/load preferences 
#include "../Utility/tinyXML.h"  //used to save/load preferences 
 
#include  
 
//change this to your name / file format version 
#define OPTIONS_VERSION "ICE v0.1" 
//change this to the file you want prefs saved to 
#define OPTIONS_FILE "data/settings/options.qXML" 
 
//SINGLETON 
// all the user set-able options, like difficulty, graphics and audio settings 
class ICE_Options { 
protected: 
 	//current configuration settings (resolution, device driver, etc) 
 	//  used for automatic device setup, DO NOT MODIFY THIS 
	static std::map m_config;	 
 
    //our game's user options ADD YOUR OPTIONS TO THIS  
	static std::map m_prefs;	 
	 
	//whether or not the current options need to be saved to file 
	static bool needsSaving; 
	 
		// class constructor 
		ICE_Options(); 
		// class destructor 
		~ICE_Options(); 
 
public: 
        //set up default options (read from file?) 
        static void Initialize(); 
         
        static void Save(); //(output to file) 
         
		static std::string getConfig(std::string key); 
		static void setConfig(std::string key, std::string val); 
		static std::string getPreference(std::string key); 
		static std::string getDeviceOption(std::string key); 
 
		//get/set/is functions: 
		//static bool isExampleOption() { return exampleOption; } 
		//static void setExampleOption(bool s) { exampleOption = s; } 
 
}; 
 
#endif // ICE_OPTIONS_H