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))); }
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))); }
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))); }
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))); }