Esempio n. 1
0
 private static void testGridWithShape()
 {
     Grid grid = new Grid(20, 20);
     grid.add(new Shape(ConsoleColor.Blue, 4, 7));
     grid.add(new ExtraShape(ConsoleColor.Green, 8, 2, Direction.BOTTOM));
     grid.print();
 }
Esempio n. 2
0
 private static void testGridSetColor()
 {
     Grid grid = new Grid(20, 20);
     grid.setColor(4, 7, ConsoleColor.Green);
     grid.setColor(13, 19, ConsoleColor.Red);
     grid.print();
 }
Esempio n. 3
0
 private static void testSimulation()
 {
     Random random = new Random();
     Grid grid = new Grid(20, 20);
     grid.bind(new ExplosionHandler());
     try
     {
         while (true)
         {
             grid.tick(random);
             // Console.Clear();
             grid.print();
             // Console.ReadKey();
         }
     }
     catch (AnnihilationException e)
     {
         Console.SetCursorPosition(0, 23);
         Console.ForegroundColor = ConsoleColor.White;
         Console.Write(e.Message);
     }
 }