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; }
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; }
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; }