Ejemplo n.º 1
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
         }
     };
 }
Ejemplo n.º 2
0
 public Puzzle ConvertPuzzle(SokobanLibraryPuzzle xmlPuzzle)
 {
     current = new Puzzle(this.model);
     current.PuzzleID = xmlPuzzle.PuzzleID;
     current.Details = xmlPuzzle.PuzzleDescription;
     current.Order = xmlPuzzle.Order;
     current.Rating = xmlPuzzle.Rating;
     Category myCat = model.GetCategoryByID(xmlPuzzle.CategoryREF);
     if (myCat != null) current.Category = myCat;
     current.Maps = new List<SokobanLibraryPuzzleMap>(xmlPuzzle.Maps).ConvertAll<PuzzleMap>(ConvertPuzzleMap);
     return current;
 }
Ejemplo n.º 3
0
 private SokobanLibraryPuzzle Convert(Puzzle source)
 {
     SokobanLibraryPuzzle res = new SokobanLibraryPuzzle();
     res.CategoryREF = source.Category == null ? null : source.Category.CategoryID;
     res.Maps = source.Maps.ConvertAll<SokobanLibraryPuzzleMap>(Convert).ToArray();
     res.PuzzleDescription = source.Details;
     res.PuzzleID = source.PuzzleID;
     res.Rating = source.Rating;
     res.Order = source.Order;
     return res;
 }
Ejemplo n.º 4
0
 public Puzzle ConvertPuzzle(SokobanLibraryPuzzle xmlPuzzle)
 {
     current = new Puzzle(this.model);
     current.PuzzleID = xmlPuzzle.PuzzleID;
     current.Details = xmlPuzzle.PuzzleDescription;
     current.Order = xmlPuzzle.Order;
     current.Rating = xmlPuzzle.Rating;
     TreeNode<Category> myCat =
         model.Categories.Root.Find(
             delegate(TreeNode<Category> item) { return item.Data.CategoryID == xmlPuzzle.CategoryREF; },
             int.MaxValue);
     if (myCat != null) current.Category = myCat.Data;
     current.Maps = new List<SokobanLibraryPuzzleMap>(xmlPuzzle.Maps).ConvertAll<PuzzleMap>(ConvertPuzzleMap);
     return current;
 }