示例#1
0
        public void TestGreaterThanFourYAxis()
        {
            var matrix = GetTileMatrix(4);

            matrix[2, 17].OnPath = true;
            matrix[4, 18].OnPath = true;
            matrix[6, 19].OnPath = true;
            var guardTileLogic = new GuardTileLogic(4, matrixSize(4), 3);

            guardTileLogic.GetMaxExitCount(3);
            guardTileLogic.GetPotentialGuardPlaces(matrix);
            Assert.AreEqual(true, guardTileLogic.GuardPlacesAreAvailable());
        }
示例#2
0
        public void TestJustRightAmountOfAvailableTiles()
        {
            var matrix = GetTileMatrix(3);

            matrix[2, 15].OnPath = true;
            matrix[4, 15].OnPath = true;
            matrix[8, 15].OnPath = true;
            var guardTileLogic = new GuardTileLogic(3, matrixSize(3), 3);

            guardTileLogic.GetMaxExitCount(3);
            guardTileLogic.GetPotentialGuardPlaces(matrix);
            Assert.AreEqual(true, guardTileLogic.GuardPlacesAreAvailable());
        }
示例#3
0
        public void TestSetGuardTiles()
        {
            var matrix = GetTileMatrix(4);

            matrix[2, 17].OnPath = true;
            matrix[4, 18].OnPath = true;
            matrix[6, 19].OnPath = true;
            var guardTileLogic = new GuardTileLogic(4, matrixSize(4), 3);

            guardTileLogic.GetMaxExitCount(4);
            guardTileLogic.GetPotentialGuardPlaces(matrix);
            guardTileLogic.SetGuardTiles();
            Assert.AreEqual(true, matrix[2, 17].HasGuard);
            Assert.AreEqual(true, matrix[4, 18].HasGuard);
            Assert.AreEqual(true, matrix[6, 19].HasGuard);
        }