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

            var filler = new RoomFilling(roomTemplate);

            filler.SetSquareUnwalkable(new Point(1, 1));
            filler.SetSquareUnwalkable(new Point(1, 2));
            filler.SetSquareUnwalkable(new Point(1, 3));
            Assert.IsFalse(filler.Connected);
        }
Esempio n. 2
0
        public void DividingRoomIntoTwoBreakingSomeConnectionsButLeavingAllDoorsWithOneRouteFails()
        {
            RoomTemplate roomTemplate = LoadTemplateFromAssemblyFile("DDRogueTest.testdata.vaults.testrouting.room"); //8x4

            var filler = new RoomFilling(roomTemplate);

            filler.SetSquareUnwalkable(new Point(4, 1));
            filler.SetSquareUnwalkable(new Point(4, 2));
            filler.SetSquareUnwalkable(new Point(3, 2));
            filler.SetSquareUnwalkable(new Point(2, 2));
            filler.SetSquareUnwalkable(new Point(2, 1));

            Assert.IsFalse(filler.Connected);
        }
Esempio n. 3
0
        public void PlacingABlockOffSideOfTemplateFails()
        {
            RoomTemplate roomTemplate = LoadTemplateFromAssemblyFile("DDRogueTest.testdata.vaults.testrouting.room"); //8x4

            var filler = new RoomFilling(roomTemplate);

            filler.SetSquareUnwalkable(new Point(-1, -11));
            Assert.IsTrue(filler.Connected);
        }
Esempio n. 4
0
        public void TestPlacingABlockInCentreOfLargeRoomAllowsPathing()
        {
            RoomTemplate roomTemplate = LoadTemplateFromAssemblyFile("DDRogueTest.testdata.vaults.testrouting.room"); //8x4

            var filler = new RoomFilling(roomTemplate);

            filler.SetSquareUnwalkable(new Point(3, 2));
            Assert.IsTrue(filler.Connected);
        }