Ejemplo n.º 1
0
 public MapParser(FOGMParser GMParser, string PathMaps, string PathCity)
 {
     this.PathCity = PathCity;
     this.PathMaps = PathMaps;
     this.Ini = new IniReader(PathMaps);
     this.GMParser = GMParser;
 }
Ejemplo n.º 2
0
 public void LoadConfigItem(IniReader ini, ConfigItem it)
 {
     string Val = ini.IniReadValue(it.Section, it.Key);
     if (string.IsNullOrEmpty(Val))
         SetVariable(it.Variable, it.Default);
     else
         SetVariable(it.Variable, ini.IniReadValue(it.Section, it.Key));
 }
Ejemplo n.º 3
0
 public LocationParser(string locationsCfgPath, MapParser mapParse, GWParser gwParse, FOGMParser gmParser)
 {
     _ini              = new IniReader(locationsCfgPath);
     _locationsCfgPath = locationsCfgPath;
     _mapParse         = mapParse;
     _gwParser         = gwParse;
     _gmParser         = gmParser;
 }
Ejemplo n.º 4
0
 public void Load()
 {
     Ini = new IniReader(".\\" + ConfigName + ".cfg");
     foreach (ConfigItem It in ConfigItems)
         LoadConfigItem(Ini, It);
     Ini = new IniReader(".\\" + ConfigName + ".user.cfg");
     foreach (ConfigItem It in UserConfigItems)
         LoadConfigItem(Ini, It);
 }
Ejemplo n.º 5
0
        List<ConfigItem> UserConfigItems = new List<ConfigItem>(); // <ConfigName>.user.cfg

        #endregion Fields

        #region Constructors

        public Config(String ConfigName)
        {
            this.ConfigName = ConfigName;

            Ini = new IniReader(".\\"+ConfigName+".cfg");
            if (!File.Exists(".\\" + ConfigName + ".cfg"))
            {
                SetDefaultValues(false);
                _firstTime = true;
            }
            if (!File.Exists(".\\" + ConfigName + ".user.cfg"))
                SetDefaultValues(true);
        }
Ejemplo n.º 6
0
 public void Load()
 {
     Ini = new IniReader(".\\" + ConfigName + ".cfg");
     foreach (ConfigItem It in ConfigItems)
     {
         LoadConfigItem(Ini, It);
     }
     Ini = new IniReader(".\\" + ConfigName + ".user.cfg");
     foreach (ConfigItem It in UserConfigItems)
     {
         LoadConfigItem(Ini, It);
     }
 }
Ejemplo n.º 7
0
 public void Save()
 {
     Ini = new IniReader(".\\" + ConfigName + ".cfg");
     foreach (ConfigItem It in ConfigItems)
     {
         Ini.IniWriteValue(It.Section, It.Key, GetVariable(It.Variable));
     }
     Ini = new IniReader(".\\" + ConfigName + ".user.cfg");
     foreach (ConfigItem It in UserConfigItems)
     {
         Ini.IniWriteValue(It.Section, It.Key, GetVariable(It.Variable));
     }
 }
Ejemplo n.º 8
0
        public Config(String ConfigName)
        {
            this.ConfigName = ConfigName;

            Ini = new IniReader(".\\" + ConfigName + ".cfg");
            if (!File.Exists(".\\" + ConfigName + ".cfg"))
            {
                SetDefaultValues(false);
                _firstTime = true;
            }
            if (!File.Exists(".\\" + ConfigName + ".user.cfg"))
            {
                SetDefaultValues(true);
            }
        }
Ejemplo n.º 9
0
 public void Save()
 {
     Ini = new IniReader(".\\" + ConfigName + ".cfg");
     foreach(ConfigItem It in ConfigItems)
         Ini.IniWriteValue(It.Section, It.Key, GetVariable(It.Variable));
     Ini = new IniReader(".\\" + ConfigName + ".user.cfg");
     foreach (ConfigItem It in UserConfigItems)
         Ini.IniWriteValue(It.Section, It.Key, GetVariable(It.Variable));
 }