示例#1
0
        public void GetYRangeForFirstRing_OfWidth1_ShallGetProperRange_2()
        {
            var result = MapPiecesSelector.GetYRangeForRing(4, 3, 1, 1);

            Assert.AreEqual(2, result.x);
            Assert.AreEqual(4, result.y);
        }
示例#2
0
        public void GetXRangeForFirstRing_OfWidth2_ShallGetProperRange_2()
        {
            var result = MapPiecesSelector.GetXRangeForRing(5, 6, 1, 2);

            Assert.AreEqual(3, result.x);
            Assert.AreEqual(7, result.y);
        }
        public void GetZeroCircleAround_ShallGetCenterTile()
        {
            var result = MapPiecesSelector.GetCircleAround(4, 4, 0, MaxX, MaxZ);

            Assert.AreEqual(1, result.Count);

            AssertContainsVector(result, new Vector2Int(4, 4));
        }
        public void GetThirdCircleAround_ShallGetProperTiles()
        {
            var result = MapPiecesSelector.GetCircleAround(4, 4, 3, MaxX, MaxZ);

            Assert.AreEqual(45, result.Count);

            AssertContainsVector(result, new Vector2Int(2, 1));
            AssertContainsVector(result, new Vector2Int(3, 1));
            AssertContainsVector(result, new Vector2Int(4, 1));
            AssertContainsVector(result, new Vector2Int(5, 1));
            AssertContainsVector(result, new Vector2Int(6, 1));

            AssertContainsVector(result, new Vector2Int(1, 2));
            AssertContainsVector(result, new Vector2Int(2, 2));
            AssertContainsVector(result, new Vector2Int(3, 2));
            AssertContainsVector(result, new Vector2Int(4, 2));
            AssertContainsVector(result, new Vector2Int(5, 2));
            AssertContainsVector(result, new Vector2Int(6, 2));
            AssertContainsVector(result, new Vector2Int(7, 2));

            AssertContainsVector(result, new Vector2Int(1, 3));
            AssertContainsVector(result, new Vector2Int(2, 3));
            AssertContainsVector(result, new Vector2Int(3, 3));
            AssertContainsVector(result, new Vector2Int(4, 3));
            AssertContainsVector(result, new Vector2Int(5, 3));
            AssertContainsVector(result, new Vector2Int(6, 3));
            AssertContainsVector(result, new Vector2Int(7, 3));

            AssertContainsVector(result, new Vector2Int(1, 4));
            AssertContainsVector(result, new Vector2Int(2, 4));
            AssertContainsVector(result, new Vector2Int(3, 4));
            AssertContainsVector(result, new Vector2Int(4, 4));
            AssertContainsVector(result, new Vector2Int(5, 4));
            AssertContainsVector(result, new Vector2Int(6, 4));
            AssertContainsVector(result, new Vector2Int(7, 4));

            AssertContainsVector(result, new Vector2Int(1, 5));
            AssertContainsVector(result, new Vector2Int(2, 5));
            AssertContainsVector(result, new Vector2Int(3, 5));
            AssertContainsVector(result, new Vector2Int(4, 5));
            AssertContainsVector(result, new Vector2Int(5, 5));
            AssertContainsVector(result, new Vector2Int(6, 5));
            AssertContainsVector(result, new Vector2Int(7, 5));

            AssertContainsVector(result, new Vector2Int(1, 6));
            AssertContainsVector(result, new Vector2Int(2, 6));
            AssertContainsVector(result, new Vector2Int(3, 6));
            AssertContainsVector(result, new Vector2Int(4, 6));
            AssertContainsVector(result, new Vector2Int(5, 6));
            AssertContainsVector(result, new Vector2Int(6, 6));
            AssertContainsVector(result, new Vector2Int(7, 6));

            AssertContainsVector(result, new Vector2Int(2, 7));
            AssertContainsVector(result, new Vector2Int(3, 7));
            AssertContainsVector(result, new Vector2Int(4, 7));
            AssertContainsVector(result, new Vector2Int(5, 7));
            AssertContainsVector(result, new Vector2Int(6, 7));
        }
        public void GetFirstCircleAround_ShallGetProperTiles()
        {
            var result = MapPiecesSelector.GetCircleAround(4, 4, 1, MaxX, MaxZ);

            Assert.AreEqual(9, result.Count);

            AssertContainsVector(result, new Vector2Int(3, 3));
            AssertContainsVector(result, new Vector2Int(4, 3));
            AssertContainsVector(result, new Vector2Int(5, 3));

            AssertContainsVector(result, new Vector2Int(3, 4));
            AssertContainsVector(result, new Vector2Int(4, 4));
            AssertContainsVector(result, new Vector2Int(5, 4));

            AssertContainsVector(result, new Vector2Int(3, 5));
            AssertContainsVector(result, new Vector2Int(4, 5));
            AssertContainsVector(result, new Vector2Int(5, 5));
        }
        public void GetSecondCircleAround_ShallGetProperTiles()
        {
            var result = MapPiecesSelector.GetCircleAround(4, 4, 2, MaxX, MaxZ);

            Assert.AreEqual(25, result.Count);

            AssertContainsVector(result, new Vector2Int(2, 2));
            AssertContainsVector(result, new Vector2Int(3, 2));
            AssertContainsVector(result, new Vector2Int(4, 2));
            AssertContainsVector(result, new Vector2Int(5, 2));
            AssertContainsVector(result, new Vector2Int(6, 2));

            AssertContainsVector(result, new Vector2Int(2, 3));
            AssertContainsVector(result, new Vector2Int(3, 3));
            AssertContainsVector(result, new Vector2Int(4, 3));
            AssertContainsVector(result, new Vector2Int(5, 3));
            AssertContainsVector(result, new Vector2Int(6, 3));

            AssertContainsVector(result, new Vector2Int(2, 4));
            AssertContainsVector(result, new Vector2Int(3, 4));
            AssertContainsVector(result, new Vector2Int(4, 4));
            AssertContainsVector(result, new Vector2Int(5, 4));
            AssertContainsVector(result, new Vector2Int(6, 4));

            AssertContainsVector(result, new Vector2Int(2, 5));
            AssertContainsVector(result, new Vector2Int(3, 5));
            AssertContainsVector(result, new Vector2Int(4, 5));
            AssertContainsVector(result, new Vector2Int(5, 5));
            AssertContainsVector(result, new Vector2Int(6, 5));

            AssertContainsVector(result, new Vector2Int(2, 6));
            AssertContainsVector(result, new Vector2Int(3, 6));
            AssertContainsVector(result, new Vector2Int(4, 6));
            AssertContainsVector(result, new Vector2Int(5, 6));
            AssertContainsVector(result, new Vector2Int(6, 6));
        }