Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 private LibraryPuzzle Convert(SokobanLibraryPuzzle xmlLib, SokobanLibraryPuzzleMap xp)
 {
     return new LibraryPuzzle(new Puzzle(xp.Row))
     {
         Name = xmlLib.PuzzleDescription != null ? xmlLib.PuzzleDescription.Name : null,
         Details = new AuthoredItem()
         {
             Name = xmlLib.PuzzleDescription != null ? xmlLib.PuzzleDescription.Name : null
         }
     };
 }
Exemplo n.º 3
0
 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;
 }