/// <summary> /// Configuration des brigades /// Voir à metrte dans un fichier externe /// </summary> void ConfigBrig() { currentLevel = 1; malusActived = typeMalus.None; string path = Application.dataPath + "/Ressources/" + Species + ".ini"; string _type = typeBrigade.ToString(); speed = float.Parse(FileGest.IniReadValue(_type, "speed", path), CultureInfo.InvariantCulture.NumberFormat); maxLife = float.Parse(FileGest.IniReadValue(_type, "maxLife", path), CultureInfo.InvariantCulture.NumberFormat); foodTaking = float.Parse(FileGest.IniReadValue(_type, "foodTaking", path), CultureInfo.InvariantCulture.NumberFormat); waterTaking = float.Parse(FileGest.IniReadValue(_type, "waterTaking", path), CultureInfo.InvariantCulture.NumberFormat); constructTaking = float.Parse(FileGest.IniReadValue(_type, "constructTaking", path), CultureInfo.InvariantCulture.NumberFormat); foodConsum = float.Parse(FileGest.IniReadValue(_type, "foodConsum", path), CultureInfo.InvariantCulture.NumberFormat); waterConsum = float.Parse(FileGest.IniReadValue(_type, "waterConsum", path), CultureInfo.InvariantCulture.NumberFormat); destructCap = float.Parse(FileGest.IniReadValue(_type, "destructCap", path), CultureInfo.InvariantCulture.NumberFormat); speedSweep = float.Parse(FileGest.IniReadValue(_type, "speedSweep", path), CultureInfo.InvariantCulture.NumberFormat); coldResist = float.Parse(FileGest.IniReadValue(_type, "coldResist", path), CultureInfo.InvariantCulture.NumberFormat); hotResist = float.Parse(FileGest.IniReadValue(_type, "hotResist", path), CultureInfo.InvariantCulture.NumberFormat); poisonResist = float.Parse(FileGest.IniReadValue(_type, "poisonResist", path), CultureInfo.InvariantCulture.NumberFormat); physicResist = float.Parse(FileGest.IniReadValue(_type, "physicResist", path), CultureInfo.InvariantCulture.NumberFormat); }
void initFile() { string path = Application.dataPath + "/Ressources/Bug.ini"; if (!File.Exists(path)) { File.WriteAllText(path, ""); } FileGest.IniWriteValue("Recolt", "speed", "1", path); FileGest.IniWriteValue("Recolt", "maxLife", "100", path); FileGest.IniWriteValue("Recolt", "foodTaking", "1", path); FileGest.IniWriteValue("Recolt", "waterTaking", "1", path); FileGest.IniWriteValue("Recolt", "constructTaking", "0", path); FileGest.IniWriteValue("Recolt", "foodConsum", "1", path); FileGest.IniWriteValue("Recolt", "waterConsum", "1", path); FileGest.IniWriteValue("Recolt", "destructCap", "0", path); FileGest.IniWriteValue("Recolt", "speedSweep", "0", path); FileGest.IniWriteValue("Recolt", "coldResist", "0", path); FileGest.IniWriteValue("Recolt", "hotResist", "0", path); FileGest.IniWriteValue("Recolt", "poisonResist", "0", path); FileGest.IniWriteValue("Recolt", "physicResist", "0", path); FileGest.IniWriteValue("Strong", "speed", "1", path); FileGest.IniWriteValue("Strong", "maxLife", "100", path); FileGest.IniWriteValue("Strong", "foodTaking", "0.5", path); FileGest.IniWriteValue("Strong", "waterTaking", "0.5", path); FileGest.IniWriteValue("Strong", "constructTaking", "1", path); FileGest.IniWriteValue("Strong", "foodConsum", "1", path); FileGest.IniWriteValue("Strong", "waterConsum", "1", path); FileGest.IniWriteValue("Strong", "destructCap", "1", path); FileGest.IniWriteValue("Strong", "speedSweep", "0", path); FileGest.IniWriteValue("Strong", "coldResist", "0.1", path); FileGest.IniWriteValue("Strong", "hotResist", "0.1", path); FileGest.IniWriteValue("Strong", "poisonResist", "0", path); FileGest.IniWriteValue("Strong", "physicResist", "0.2", path); FileGest.IniWriteValue("Scout", "speed", "1.5", path); FileGest.IniWriteValue("Scout", "maxLife", "100", path); FileGest.IniWriteValue("Scout", "foodTaking", "0.5", path); FileGest.IniWriteValue("Scout", "waterTaking", "0.5", path); FileGest.IniWriteValue("Scout", "constructTaking", "0", path); FileGest.IniWriteValue("Scout", "foodConsum", "1", path); FileGest.IniWriteValue("Scout", "waterConsum", "1", path); FileGest.IniWriteValue("Scout", "destructCap", "0", path); FileGest.IniWriteValue("Scout", "speedSweep", "0", path); FileGest.IniWriteValue("Scout", "coldResist", "0.2", path); FileGest.IniWriteValue("Scout", "hotResist", "0.2", path); FileGest.IniWriteValue("Scout", "poisonResist", "0", path); FileGest.IniWriteValue("Scout", "physicResist", "0", path); FileGest.IniWriteValue("Sabot", "speed", "1", path); FileGest.IniWriteValue("Sabot", "maxLife", "100", path); FileGest.IniWriteValue("Sabot", "foodTaking", "0.5", path); FileGest.IniWriteValue("Sabot", "waterTaking", "0.5", path); FileGest.IniWriteValue("Sabot", "constructTaking", "0.5", path); FileGest.IniWriteValue("Sabot", "foodConsum", "1", path); FileGest.IniWriteValue("Sabot", "waterConsum", "1", path); FileGest.IniWriteValue("Sabot", "destructCap", "0", path); FileGest.IniWriteValue("Sabot", "speedSweep", "1", path); FileGest.IniWriteValue("Sabot", "coldResist", "0", path); FileGest.IniWriteValue("Sabot", "hotResist", "0", path); FileGest.IniWriteValue("Sabot", "poisonResist", "0.2", path); FileGest.IniWriteValue("Sabot", "physicResist", "0", path); }