Exemple #1
0
 void ShowForest(Board board)
 {
     Console.Write("--------------");
     foreach (var child in board.Forest.Children)
     {
         Console.Write("---");
     }
     Console.Write("\n");
     Console.Write("Forest bevat: ");
     foreach (var child in board.Forest.Children)
     {
         var pawn = child as Pawn;
         Console.ForegroundColor = FieldToColors.GetPawnColor(pawn.Owner.Number).Foreground;
         Console.Write(pawn.Number);
         Console.ForegroundColor = Colors.DefaultForeground;
         Console.Write(", ");
     }
     Console.ForegroundColor = Colors.DefaultForeground;
     Console.Write("| \n");
     Console.Write("--------------");
     foreach (var child in board.Forest.Children)
     {
         Console.Write("---");
     }
     Console.Write("\n");
 }
Exemple #2
0
        void Show(BaseField obj)
        {
            Colors colors = FieldToColors.Convert(obj);

            Console.BackgroundColor = colors.Background;
            Console.ForegroundColor = colors.Foreground;

            Console.Write(FieldToString.Convert(obj));

            Console.BackgroundColor = Colors.DefaultBackground;
            Console.ForegroundColor = Colors.DefaultForeground;
        }