private SokobanLibraryPuzzleMap Convert(PuzzleMap input) { SokobanLibraryPuzzleMap res = new SokobanLibraryPuzzleMap(); res.MapID = input.MapID; res.Rating = input.Rating; res.Row = input.Map.ToStringArray(null); res.Solutions = input.Solutions.ConvertAll<SokobanLibraryPuzzleMapSolution>(Convert).ToArray(); res.MapDetails = input.Details; return res; }
public PuzzleMap ConvertPuzzleMap(SokobanLibraryPuzzleMap xmlPuzzleMap) { currentMap = new PuzzleMap(current); currentMap.MapID = xmlPuzzleMap.MapID; currentMap.Details = xmlPuzzleMap.MapDetails; currentMap.Rating = xmlPuzzleMap.Rating; currentMap.Map = new SokobanMap(); currentMap.Map.SetFromStrings(xmlPuzzleMap.Row); currentMap.Solutions = new List<SokobanLibraryPuzzleMapSolution>(xmlPuzzleMap.Solutions).ConvertAll<Solution>( ConvertSolution); return currentMap; }