Ejemplo n.º 1
0
        public void TestPlacingABlockInCentreOfLargeRoomAllowsPathing()
        {
            RoomTemplate roomTemplate = LoadTemplateFromAssemblyFile("DDRogueTest.testdata.vaults.testrouting.room"); //8x4

            var roomRouting = new RoomRouting(roomTemplate);

            Assert.IsTrue(roomRouting.SetSquareUnwalkableIfDoorPathingIsPreserved(new Point(3, 2)));
        }
Ejemplo n.º 2
0
        public void PlacingABlockOffSideOfTemplateFails()
        {
            RoomTemplate roomTemplate = LoadTemplateFromAssemblyFile("DDRogueTest.testdata.vaults.testrouting.room"); //8x4

            var roomRouting = new RoomRouting(roomTemplate);

            Assert.IsFalse(roomRouting.SetSquareUnwalkableIfDoorPathingIsPreserved(new Point(-1, -1)));
        }
Ejemplo n.º 3
0
        public void CompletelyBlockingOffADoorwayFails()
        {
            RoomTemplate roomTemplate = LoadTemplateFromAssemblyFile("DDRogueTest.testdata.vaults.testrouting.room"); //8x4

            var roomRouting = new RoomRouting(roomTemplate);

            roomRouting.SetSquareUnwalkableIfDoorPathingIsPreserved(new Point(1, 1));
            roomRouting.SetSquareUnwalkableIfDoorPathingIsPreserved(new Point(1, 2));
            Assert.IsFalse(roomRouting.SetSquareUnwalkableIfDoorPathingIsPreserved(new Point(1, 3)));
        }
Ejemplo n.º 4
0
        public void DividingRoomIntoTwoBreakingSomeConnectionsButLeavingAllDoorsWithOneRouteFails()
        {
            RoomTemplate roomTemplate = LoadTemplateFromAssemblyFile("DDRogueTest.testdata.vaults.testrouting.room"); //8x4

            var roomRouting = new RoomRouting(roomTemplate);

            roomRouting.SetSquareUnwalkableIfDoorPathingIsPreserved(new Point(4, 1));
            roomRouting.SetSquareUnwalkableIfDoorPathingIsPreserved(new Point(4, 2));
            roomRouting.SetSquareUnwalkableIfDoorPathingIsPreserved(new Point(3, 2));
            roomRouting.SetSquareUnwalkableIfDoorPathingIsPreserved(new Point(2, 2));
            Assert.IsFalse(roomRouting.SetSquareUnwalkableIfDoorPathingIsPreserved(new Point(2, 3)));
        }