Ejemplo n.º 1
0
 public SokobanLibrary Convert(Library source)
 {
     SokobanLibrary res = new SokobanLibrary();
     res.LibraryID = source.LibraryID;
     res.Rating = source.Rating;
     res.Details = source.Details;
     res.Puzzles = source.Puzzles.ConvertAll<SokobanLibraryPuzzle>(Convert).ToArray();
     res.Categories = source.Categories.ConvertAll<SokobanLibraryCategory>(Convert).ToArray();
     res.MaxID = source.IdProvider.GetCurrentID();
     return res;
 }
Ejemplo n.º 2
0
 private Library Convert(SokobanLibrary xmlLib)
 {
     var lib = new Library();
     foreach (var puzzle in xmlLib.Puzzles)
     {
         var map = puzzle.Maps.FirstOrDefault();
         if (map != null && map.Row != null)
         {
             lib.Add(Convert(puzzle, map));
         }
     }
     return lib;
 }
Ejemplo n.º 3
0
            public SokobanLibrary Convert(Library source)
            {
                SokobanLibrary res = new SokobanLibrary();
                res.LibraryID = source.LibraryID;
                res.Rating = source.Rating;
                res.Details = source.Details;
                res.Puzzles = source.Puzzles.ConvertAll<SokobanLibraryPuzzle>(Convert).ToArray();
                res.Categories = source.Categories.Root.ToList().ConvertAll<SokobanLibraryCategory>(Convert).ToArray();

                return res;
            }