Beispiel #1
0
        static void Main(string[] args)
        {
            GameSettings initialSettings = new GameSettings(settingspath);
            Sequences    sequences       = new Sequences(sequencespath);

            Console.WriteLine("Initial Settings x {0}, y {1}, Start Direction {2}", initialSettings.ExitPoint_x, initialSettings.ExitPoint_y, initialSettings.StartingDirection);
            Console.WriteLine("Board Size {0},{1} ; Finish {2},{3}", initialSettings.BoardSize_x, initialSettings.BoardSize_y, initialSettings.ExitPoint_x, initialSettings.ExitPoint_y);


            //Test1
            Turtle Ninj = new Turtle();

            Ninj.NinjFactor = 1;
            TurtleGameActions TurtleSeaAnimalsGame = new TurtleGameActions(Ninj, initialSettings, sequences);

            //Choosing first line of sequences for test
            Ninj = TurtleSeaAnimalsGame.TurtleGameRun(0);

            if (Ninj.AnimalHasLost == false && Ninj.AnimalHasWon == false)
            {
                Console.WriteLine("Test1 : Game Result is correct. TEST PASS");
            }
            else
            {
                Console.WriteLine("Test1 : Game Result is incorrect. TEST FAIL.");
            }

            Console.WriteLine();

            //Test2
            Dolphin Flipper = new Dolphin();

            Flipper.Speed = 1;
            Console.WriteLine("Dolphin Speed {0}", Flipper.Speed);
            DolphinGameActions DolphinSeaAnimalsGame = new DolphinGameActions(Flipper, initialSettings, sequences);

            ////Choosing first 4th line of sequences for test
            Flipper = DolphinSeaAnimalsGame.DolphinGameRun(3);

            if (Flipper.x_position == 2 && Flipper.y_position == 4)
            {
                Console.WriteLine("Test2 : Final Co-ords correct. TEST PASS");
            }
            else
            {
                Console.WriteLine("Test2 : Final Co-ords incorrect. TEST FAIL");
            }

            Console.ReadKey();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            //Initialisation.
            GameSettings initialSettings = new GameSettings(settingspath);
            Sequences    sequences       = new Sequences(sequencespath);

            Console.WriteLine("Initial Settings for both games: x {0}, y {1}, Start Direction {2}", initialSettings.ExitPoint_x, initialSettings.ExitPoint_y, initialSettings.StartingDirection);
            Console.WriteLine("Board Size {0},{1} ; Finish {2},{3}", initialSettings.BoardSize_x, initialSettings.BoardSize_y, initialSettings.ExitPoint_x, initialSettings.ExitPoint_y);

            Console.WriteLine("SeaAnimal-Turtle Game");

            //This is runs 5 sets of sequences so 5 Games
            for (int i = 0; i < 4; i++)
            {
                Turtle Ninj = new Turtle();
                Ninj.NinjFactor = 1;
                TurtleGameActions TurtleSeaAnimalsGame = new TurtleGameActions(Ninj, initialSettings, sequences);
                Ninj = TurtleSeaAnimalsGame.TurtleGameRun(i);
                Console.WriteLine("NINJ_FACTOR {0}", Ninj.NinjFactor);
                Console.WriteLine();
            }
            Console.WriteLine("Any Key to continue with SeaAnimal-Dolphin Game");
            Console.ReadKey();

            Console.WriteLine("SeaAnimal-Dolphin Game");
            //This is runs 5 sets of sequences so 5 Games
            for (int i = 0; i < 4; i++)
            {
                Dolphin Flipper = new Dolphin();
                Flipper.Speed = i;
                Console.WriteLine("Dolphin Speed {0}", Flipper.Speed);
                DolphinGameActions DolphinSeaAnimalsGame = new DolphinGameActions(Flipper, initialSettings, sequences);
                Flipper = DolphinSeaAnimalsGame.DolphinGameRun(i);
            }

            Console.ReadKey();
        }