예제 #1
0
 internal static void AppendGamespaceDistance(this StringBuilder sb, Gamespace s)
 {
     if (s.DistanceFromEnd.HasValue)
     {
         sb.Append(s.DistanceFromEnd.Value.ToString("00 "));
     }
     else
     {
         sb.Append("?? ");
     }
 }
예제 #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);
     }
 }