Beispiel #1
0
        /// <summary>
        /// MainGame constructor
        /// The board is made out of hexagones
        /// 0,0 is on the top left and
        /// 7,7 is on the bottom right.
        /// </summary>
        public MainGame()
        {
            _log.Debug("Starting Game");
            Board = new Plateau(8, 8);

            _pointManager    = new PointHelper();
            _isolationHelper = new IsolationVerificationHelper(Board);
            _endGameHelper   = new EndGameHelper();
            _movementHelper  = new MovementVerificationHelper(Board);

            _aiEasy   = new AiEasy(Board);
            _aiMedium = new AiMedium(Board);
            // her would the AI  hard initialization
            Players       = new List <IPlayer>();
            CurrentPlayer = null;

            StateChanged?.Invoke(this, null); //sets the game in th ready state
        }
        public void TestPenguinIsIsolated()
        {
            Cell[,] board = new Cell[3, 3];

            board[0, 0] = new Cell(CellType.Water, 1, 0, 0);
            board[0, 1] = new Cell(CellType.Water, 1, 0, 1);
            board[0, 2] = new Cell(CellType.Water, 1, 0, 2);

            board[1, 0] = new Cell(CellType.Water, 1, 1, 0);
            board[1, 1] = new Cell(CellType.FishWithPenguin, 1, 1, 1);
            board[1, 2] = new Cell(CellType.Water, 1, 1, 2);

            board[2, 0] = new Cell(CellType.Water, 1, 2, 0);
            board[2, 1] = new Cell(CellType.Water, 1, 2, 1);
            board[2, 2] = new Cell(CellType.Water, 1, 2, 2);

            Plateau TestBoard = new Plateau(board);

            IsolationVerificationHelper helperTest = new IsolationVerificationHelper(TestBoard);

            bool IsIsolated = helperTest.VerifyIsolation(board[1, 1]);

            Assert.IsTrue(IsIsolated);
        }