Skip to content

How to know whether a move is a royal marriage?

Michael Cochez edited this page Jan 5, 2024 · 1 revision

Assuming you have a move variable containing the move you want to check, you first check whether it is a marriage. If that is the case, you can call as_marriage which converts it into the right type. With that new object, you can ask what the suit of the king card is and compare that to the trump suit.

In code that would be as follows:

if move.is_marriage():
    marriage_move = move.as_marriage()
    if marriage_move.king_card.suit == perspective.get_trump_suit():
        # Here we are sure this is a royal marriage