Example #1
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)));
        }
Example #2
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)));
        }
Example #3
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)));
        }
Example #4
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)));
        }