public void CreateNewArmy(string name)
 {
     currentSave = new ArmySave
     {
         saveName = name,
     };
 }
 public bool IsCorrectSave(ArmySave save)
 {
     if (save == null)
     {
         return(false);
     }
     if (save.GetRace() == Race.Neutral)
     {
         Debug.LogError("deleted - no Race!");
         //File.Delete(armySavePath + "/" + save.saveName + "." + saveExtension);
         return(false);
     }
     if (save.GetHero() == null)
     {
         Debug.LogError("deleted - nonexistant hero path");
         //File.Delete(armySavePath + "/" + save.saveName + "." + saveExtension);
         return(false);
     }
     return(true);
 }
        public bool HasArmyOfRace(Race race)
        {
            var allSaves = GetAllSaveNames(armySavePath);

            if (allSaves != null)
            {
                foreach (var saveName in allSaves)
                {
                    ArmySave save = GetArmy(saveName);
                    if (save.GetRace() == Race.Neutral)
                    {
                        Debug.Log("deleted");
                        SerializationManager.instance.Delete(armySavePath + "/" + saveName + "." + Global.instance.armySavingManager.saveExtension);
                        continue;
                    }
                    if (save.GetRace() == race)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
 public void LoadArmy(string path)
 {
     currentSave = GetArmy(path);
 }
 public void OnClickSaveArmy()
 {
     SerializationManager.instance.Save(currentSave.saveName, armySavePath, currentSave, saveExtension);
     currentSave = null;
 }
 public void OnClickNewArmy()
 {
     currentSave = null;
 }
 public void ResetCurrentSaveToNull()
 {
     currentSave = null;
 }