Esempio n. 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());
        }
Esempio n. 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());
        }
Esempio n. 3
0
        public void TestGuardPlacesFilledWithEnvTiles()
        {
            var matrix = GetTileMatrix(3);

            foreach (var envTile in matrix)
            {
                envTile.HasEnv = true;
            }

            var guardTileLogic = new GuardTileLogic(3, matrixSize(3), 3);

            guardTileLogic.GetPotentialGuardPlaces(matrix);
            Assert.AreEqual(false, guardTileLogic.GuardPlacesAreAvailable());
        }
Esempio n. 4
0
        public void TestIfCanSpawnBetweenPillars()
        {
            var matrix = GetTileMatrix(3);

            matrix[1, 15].HasEnv  = true;
            matrix[2, 15].HasEnv  = true;
            matrix[3, 15].OnPath  = true;
            matrix[4, 15].HasEnv  = true;
            matrix[5, 15].OnPath  = true;
            matrix[6, 15].HasEnv  = true;
            matrix[7, 15].HasEnv  = true;
            matrix[8, 15].HasEnv  = true;
            matrix[9, 15].OnPath  = true;
            matrix[10, 15].HasEnv = true;
            matrix[11, 15].HasEnv = true;
            matrix[12, 15].HasEnv = true;
            matrix[13, 15].HasEnv = true;
            matrix[14, 15].HasEnv = true;
            matrix[15, 15].HasEnv = true;
            var guardTileLogic = new GuardTileLogic(3, matrixSize(3), 3);

            guardTileLogic.GetPotentialGuardPlaces(matrix);
            Assert.AreEqual(false, guardTileLogic.GuardPlacesAreAvailable());
        }