public void LoadProgression() { FileStream FS = new FileStream("SRWE Save.bin", FileMode.Open, FileAccess.Read); BinaryReader BR = new BinaryReader(FS); BattleMap.DicRouteChoices.Clear(); PlayerRoster.TeamCharacters.Clear(); PlayerRoster.TeamUnits.Clear(); PlayerRoster.TeamSquads.Clear(); BattleMap.NextMapType = BR.ReadString(); BattleMap.NextMapPath = BR.ReadString(); int DicGlobalVariablesCount = BR.ReadInt32(); for (int R = 0; R < DicGlobalVariablesCount; R++) { string RouteKey = BR.ReadString(); string RouteValue = BR.ReadString(); BattleMap.DicGlobalVariables.Add(RouteKey, RouteValue); } int DicRouteChoicesCount = BR.ReadInt32(); for (int R = 0; R < DicRouteChoicesCount; R++) { string RouteKey = BR.ReadString(); int RouteValue = BR.ReadInt32(); BattleMap.DicRouteChoices.Add(RouteKey, RouteValue); } PlayerRoster.LoadTeam(BR, DicUnitType, DicRequirement, DicEffect); int ListPartCount = BR.ReadInt32(); for (int P = 0; P < ListPartCount; P++) { string LoadedPartPath = BR.ReadString(); string[] PartByType = LoadedPartPath.Split('/'); if (PartByType[0] == "Standard Parts") { SystemList.ListPart.Add(LoadedPartPath, new UnitStandardPart("Content/Units/" + LoadedPartPath + ".pep", DicRequirement, DicEffect)); } else if (PartByType[0] == "Consumable Parts") { SystemList.ListPart.Add(LoadedPartPath, new UnitConsumablePart("Content/Units/" + LoadedPartPath + ".pep", DicRequirement, DicEffect)); } } FS.Close(); BR.Close(); }
public static void LoadProgression(BinaryReader BR, Roster PlayerRoster, Dictionary <string, Unit> DicUnitType, Dictionary <string, BaseSkillRequirement> DicRequirement, Dictionary <string, BaseEffect> DicEffect, Dictionary <string, AutomaticSkillTargetType> DicAutomaticSkillTarget, Dictionary <string, ManualSkillTarget> DicManualSkillTarget) { BattleMap.DicGlobalVariables.Clear(); BattleMap.DicRouteChoices.Clear(); BattleMap.NextMapType = BR.ReadString(); BattleMap.NextMapPath = BR.ReadString(); BattleMap.ClearedStages = BR.ReadInt32(); Constants.Money = BR.ReadInt32(); int DicGlobalVariablesCount = BR.ReadInt32(); for (int R = 0; R < DicGlobalVariablesCount; R++) { string RouteKey = BR.ReadString(); string RouteValue = BR.ReadString(); BattleMap.DicGlobalVariables.Add(RouteKey, RouteValue); } int DicRouteChoicesCount = BR.ReadInt32(); for (int R = 0; R < DicRouteChoicesCount; R++) { string RouteKey = BR.ReadString(); int RouteValue = BR.ReadInt32(); BattleMap.DicRouteChoices.Add(RouteKey, RouteValue); } PlayerRoster.LoadTeam(BR, DicUnitType, DicRequirement, DicEffect, DicAutomaticSkillTarget, DicManualSkillTarget); SystemList.ListPart.Clear(); int ListPartCount = BR.ReadInt32(); for (int P = 0; P < ListPartCount; P++) { string LoadedPartPath = BR.ReadString(); string[] PartByType = LoadedPartPath.Split('/'); if (PartByType[0] == "Standard Parts") { SystemList.ListPart.Add(LoadedPartPath, new UnitStandardPart("Content/Units/" + LoadedPartPath + ".pep", DicRequirement, DicEffect, DicAutomaticSkillTarget)); } else if (PartByType[0] == "Consumable Parts") { SystemList.ListPart.Add(LoadedPartPath, new UnitConsumablePart("Content/Units/" + LoadedPartPath + ".pep", DicRequirement, DicEffect, DicAutomaticSkillTarget, DicManualSkillTarget)); } } }