/// <summary> /// Load a Pawn from the .sav file /// </summary> /// <param name="savSlot">The Pawn to load</param> /// <param name="savRoot">The .sav file</param> /// <returns>The loaded Pawn, or null if no Pawn was loaded</returns> public static PawnData LoadPawnSav(SavSlot savSlot, XElement savRoot) { PawnData loadPawn = new PawnData(); savConfigRootClass.LoadSavToPawn(loadPawn, savRoot, savSlot); return(loadPawn); }
private static PawnData LoadPawnVersion1(XElement pawnFile) { SavConfigClass appearanceConfig = null; foreach (SavConfigElement childElement in savConfigRootClass.Children) { SavConfigClass childClass = childElement as SavConfigClass; if (childClass != null && childClass.Name == "mEdit") { appearanceConfig = childClass; break; } } if (appearanceConfig == null) { return(null); } PawnData loadPawn = new PawnData(); appearanceConfig.LoadSavToPawn(loadPawn, pawnFile, SavSlot.MainPawn); return(loadPawn); }