bool isDoorApplicable(RoomDoor roomDoor, Room otherRoom, Door otherDoor) { if (!Door.Opposite(roomDoor.door.position, otherDoor.position)) { return(false); } Room cloneOther = otherRoom.clone(); Room.ConnectDoors(roomDoor.room.clone(), roomDoor.door.clone(), cloneOther, otherDoor.clone()); if (actualState.Overlaps(cloneOther)) { return(false); } return(true); }