def maybe_connect_two_way(world, a, b, player):
    if (a.type in [DoorType.Open, DoorType.StraightStairs, DoorType.Hole, DoorType.Warp, DoorType.Ladder, DoorType.Interior, DoorType.Logical]):
        return
    if ((a.type == DoorType.Normal) or (a.type == DoorType.SpiralStairs)):
        if a.blocked:
            connect_one_way(world, b.name, a.name, player)
        elif b.blocked:
            connect_one_way(world, a.name, b.name, player)
        else:
            connect_two_way(world, a.name, b.name, player)
        return
    raise RuntimeError(('Unknown door type ' + a.type.name))
def maybe_connect_two_way(world, a, b, player):
    if (a.type in [DoorType.Open, DoorType.StraightStairs, DoorType.Hole, DoorType.Warp, DoorType.Ladder, DoorType.Interior, DoorType.Logical]):
        return
    if ((a.type == DoorType.Normal) or (a.type == DoorType.SpiralStairs)):
        if a.blocked:
            connect_one_way(world, b.name, a.name, player)
        elif b.blocked:
            connect_one_way(world, a.name, b.name, player)
        else:
            connect_two_way(world, a.name, b.name, player)
        return
    raise RuntimeError(('Unknown door type ' + a.type.name))