Exemple #1
0
 public Gamespace Add(Gamespace space)
 {
     if (_path.Any())
         _path.AddAfter(_path.Last, space);
     else
         _path.AddFirst(space);
     return space;
 }
Exemple #2
0
 public Gameboard(int size, IEnumerable<KeyValuePair<int, int>> pathways)
 {
     _spaces.Clear();
     for (int i = 1; i <= size; i++)
     {
         var newSpace = new Gamespace() { Index = i };
         if (pathways.Any(p => p.Key == i))
             newSpace.PathTo = pathways.Single(p => p.Key == i).Value;
         _spaces.Add(newSpace);
     }
 }
Exemple #3
0
 public Gamespace Add(Gamespace space)
 {
     if (_path.Any())
     {
         _path.AddAfter(_path.Last, space);
     }
     else
     {
         _path.AddFirst(space);
     }
     return(space);
 }
Exemple #4
0
 public Gameboard(int size, IEnumerable <KeyValuePair <int, int> > pathways)
 {
     _spaces.Clear();
     for (int i = 1; i <= size; i++)
     {
         var newSpace = new Gamespace()
         {
             Index = i
         };
         if (pathways.Any(p => p.Key == i))
         {
             newSpace.PathTo = pathways.Single(p => p.Key == i).Value;
         }
         _spaces.Add(newSpace);
     }
 }