Exemple #1
0
 public void Constructor_Test_Rows_Lenght()
 {
     Playfield palyfield = new Playfield();
     int actual = palyfield.Labyrinth.GetLength(0);
     var expected = Playfield.PlayfieldRows;
     Assert.AreEqual(expected, actual);
 }
Exemple #2
0
 public Engine(ObjectRenderer renderer, Player player, Playfield playfield, Scoreboard scoreboard)
 {
     this.renderer = renderer;
     this.player = player;
     this.playfield = playfield;
     this.scoreboard = scoreboard;
 }
Exemple #3
0
        public void Render(Playfield playfield, Player player)
        {
            for (int row = 0; row < 7; row++)
            {
                for (int col = 0; col < 7; col++)
                {
                    if (player.GetPosition.Row == row && player.GetPosition.Col == col)
                    {
                        Console.Write("*");
                    }
                    else
                    {
                        if (playfield.Labyrinth[row, col] == 0)
                        {
                            Console.Write("-");
                        }
                        else
                        {
                            Console.Write("X");
                        }
                    }
                }

                Console.WriteLine(Message.PrintNewLine());
            }
        }
Exemple #4
0
 static void Main()
 {
     ObjectRenderer renderer = new ObjectRenderer();
     Player player = new Player();
     Playfield playfield = new Playfield();
     Scoreboard scoreboard = new Scoreboard();
     Engine engine = new Engine(renderer, player, playfield, scoreboard);
     engine.Run();
     Console.Write("Good Bye!");
     Console.ReadKey();
 }
Exemple #5
0
 public void IsVisitedPosition_Test_False()
 {
     BindingFlags eFlags = BindingFlags.Instance | BindingFlags.NonPublic;
     Playfield palyfield = new Playfield();
     Player player = new Player();
     Direction direction = Direction.Left;
     Object[] arguments = new object[] { player, direction };
     MethodInfo testedMethod = typeof(Playfield).GetMethod("IsVisitedPosition", eFlags);
     bool actual = (bool)testedMethod.Invoke(palyfield, arguments);
     bool expected = false;
     Assert.AreEqual(expected, actual);
 }