public static void LoadDataToRankData() { if (System.IO.File.Exists(baseSavePath + "/rank.dat")) { RankData.scores = FileReadWrite.ReadFromBinaryFile <List <int> >(baseSavePath + "/rank.dat"); } }
public static CurrencySaveData LoadCurrency(string path) { string filePath = baseSavePath + "/" + path + ".dat"; if (System.IO.File.Exists(filePath)) { return(FileReadWrite.ReadFromBinaryFile <CurrencySaveData>(filePath)); } return(null); }
public static ItemContainerSaveData _LoadItems(string path) { string filePath = baseSavePath + "/" + path + ".dat"; if (System.IO.File.Exists(filePath)) { return(FileReadWrite.ReadFromBinaryFile <ItemContainerSaveData>(filePath)); } return(null); }
public static DataHero LoadData(string fileName) { string filePath = baseSavePath + "/" + fileName + ".dat"; if (System.IO.File.Exists(filePath)) { return(FileReadWrite.ReadFromBinaryFile <DataHero>(filePath)); } return(null); }
public static GameProgressSaveData LoadGameProgress() { var filePath = Path.Combine(baseSavePath, "progress.dat"); if (File.Exists(filePath)) { return(FileReadWrite.ReadFromBinaryFile <GameProgressSaveData>(filePath)); } return(null); }
public static List <MyConfiguration> LoadItems(string path) { string filePath = baseSavePath + "/" + path + ".dat"; if (System.IO.File.Exists(filePath)) { return(FileReadWrite.ReadFromBinaryFile <List <MyConfiguration> >(filePath)); } return(null); }
public static T loadData <T>(string path) { string filePath = baseSavePath + "/" + path + ".dat"; if (System.IO.File.Exists(filePath)) { return(FileReadWrite.ReadFromBinaryFile <T>(filePath)); } return(default(T)); }
public static ItemContainerSaveData LoadItems(string fileName) { string filePath = baseSavePath + "/" + fileName + ".dat"; if (System.IO.File.Exists(filePath)) { return(FileReadWrite.ReadFromBinaryFile <ItemContainerSaveData>(filePath)); } else { Debug.LogError("Save file not found in" + filePath); return(null); } }
public bool LoadGeneration(string filePath) { if (!System.IO.File.Exists(filePath)) { return(false); } GeneticSaveData <T> save = FileReadWrite.ReadFromBinaryFile <GeneticSaveData <T> >(filePath); Generation = save.Generation; for (int i = 0; i < save.PopulationGenes.Count; i++) { if (i >= Population.Count) { Population.Add(new DNA <T>(dnaSize, random, getRandomGene, fitnessFunction, crossoverType, shouldInitGenes: false)); } Array.Copy(save.PopulationGenes[i], Population[i].Genes, dnaSize); } return(true); }