def doors_compatible(a, b):
    if (a.type != b.type):
        return False
    if (a.type == DoorType.Open):
        return doors_fit_mandatory_pair(open_edges, a, b)
    if (a.type == DoorType.StraightStairs):
        return doors_fit_mandatory_pair(straight_staircases, a, b)
    if (a.type == DoorType.Interior):
        return doors_fit_mandatory_pair(interior_doors, a, b)
    if (a.type == DoorType.Ladder):
        return doors_fit_mandatory_pair(ladders, a, b)
    if ((a.type == DoorType.Normal) and (a.smallKey or b.smallKey or a.bigKey or b.bigKey)):
        return doors_fit_mandatory_pair(key_doors, a, b)
    if (a.type in [DoorType.Hole, DoorType.Warp, DoorType.Logical]):
        return False
    return (a.direction == switch_dir(b.direction))
def doors_compatible(a, b):
    if (a.type != b.type):
        return False
    if (a.type == DoorType.Open):
        return doors_fit_mandatory_pair(open_edges, a, b)
    if (a.type == DoorType.StraightStairs):
        return doors_fit_mandatory_pair(straight_staircases, a, b)
    if (a.type == DoorType.Interior):
        return doors_fit_mandatory_pair(interior_doors, a, b)
    if (a.type == DoorType.Ladder):
        return doors_fit_mandatory_pair(ladders, a, b)
    if ((a.type == DoorType.Normal) and (a.smallKey or b.smallKey or a.bigKey or b.bigKey)):
        return doors_fit_mandatory_pair(key_doors, a, b)
    if (a.type in [DoorType.Hole, DoorType.Warp, DoorType.Logical]):
        return False
    return (a.direction == switch_dir(b.direction))