|
| enum | HandState {
HAND_DRAW
, HAND_SELECT
, HAND_SHUFFLING
, HAND_DISCARD
,
HAND_PLAY
, HAND_PLAYING
} |
| |
| enum | HandType {
NONE
, HIGH_CARD
, PAIR
, TWO_PAIR
,
THREE_OF_A_KIND
, STRAIGHT
, FLUSH
, FULL_HOUSE
,
FOUR_OF_A_KIND
, STRAIGHT_FLUSH
, ROYAL_FLUSH
, FIVE_OF_A_KIND
,
FLUSH_HOUSE
, FLUSH_FIVE
, HAND_TYPE_MAX = FLUSH_FIVE
} |
| |
|
| const char * | get_hand_type_name (enum HandType hand_type) |
| |
| void | set_hand_state (enum HandState) |
| | Set the hand state. Primarily used by the GAME_PLAYING game state.
|
| |
| enum HandState | get_hand_state (void) |
| | Get the hand state.
|
| |
| void | compute_hand_value_info (void) |
| | Determine the HandType and ContainedHandTypes of the currently selected Cards, then print the Hand's name, chips, and mult on screen.
|
| |
| enum HandType | get_hand_type (void) |
| | Get the current hand type.
|
| |
| ContainedHandTypes * | get_contained_hands (void) |
| | Get the contained hands within the selected hand.
|
| |
| CardObject ** | get_hand_array (void) |
| | Get the hand array of Cards currently held in hand.
|
| |
| int | get_hand_top (void) |
| | Get the position in hand array of the last card obtained.
|
| |
| void | set_hand_top (int new_hand_top) |
| | Set the position in hand array of the last card obtained.
|
| |
| int | hand_nb_held_cards (void) |
| | Get the current number of Cards in hand.
|
| |
| int | hand_get_nb_selected_cards (void) |
| | Get the current number of selected Cards.
|
| |
| void | hand_set_nb_selected_cards (int new_selections) |
| | Set the current number of selected Cards.
|
| |
| void | hand_select_card (int index) |
| | Set the card at a given index in Hand as selected.
|
| |
| void | hand_change_sort (bool to_sort_by_suit) |
| | Switch to the given sort method. Can sort playing cards in two ways: by rank and suit. The order of suits is as follows:
|
| |
| void | hand_deselect_all_cards (void) |
| | Deselect all cards in hand.
|
| |
| void | swap_cards_in_hand (int idx_a, int idx_b) |
| | Swaps the order of two cards in hand.
|
| |
| void | reorder_card_sprites_layers (void) |
| | Destroy the sprites of the Cards held in hand and recreate then in the same order as the Cards in the hand array. This allows Cards to render properly when help in hand during the round or a Tarot/Spectral booster pack.
|
| |
| void | sort_cards (void) |
| | Sort the hand array according to the selected method to do that.
|
| |
| int | find_flush_in_played_cards (CardObject **played, int top, int min_len, bool *out_selection) |
| | Finds the best flush (set of cards with the same suit) in the given array of played cards.
|
| |
| int | find_straight_in_played_cards (CardObject **played, int top, int min_len, bool *out_selection) |
| | Finds the best straight in the given array of played cards.
|
| |
| void | select_paired_cards_in_hand (CardObject **played, int top, bool *selection) |
| | This is used for the special case in "Four Fingers" where you can add a pair into a straight (e.g. AA234 should score all 5 cards)
|
| |
Functions relative to manipulating and analyzing the contents of the Hand, a.k.a. the Cards we hold and play.
Definition in file hand.h.
| int find_flush_in_played_cards |
( |
CardObject ** |
played, |
|
|
int |
top, |
|
|
int |
min_len, |
|
|
bool * |
out_selection |
|
) |
| |
Finds the best flush (set of cards with the same suit) in the given array of played cards.
Normally a Flush is made of 5 cards of the same suit, but this function takes into account the Four Fingers joker which allows for Flushes made of 4 cards only.
The cards belonging to that flush will be marked as selected in the out_selection array.
- Parameters
-
| played | Array of pointers to CardObject representing played cards. |
| top | Index of the top of the played stack. |
| min_len | Minimum number of cards required for a flush. |
| out_selection | Output array of bools; set to true for cards in the best flush, false otherwise. |
- Returns
- The number of cards in the best flush found, or 0 if no flush meets min_len.
Definition at line 544 of file hand.c.
| int find_straight_in_played_cards |
( |
CardObject ** |
played, |
|
|
int |
top, |
|
|
int |
min_len, |
|
|
bool * |
out_selection |
|
) |
| |
Finds the best straight in the given array of played cards.
Normally, a Straight is a set of 5 cards with sequential ranks, but this function takes into account the Four Fingers and Shortcut jokers, which respectively allow for Straights made of 4 cards and with gaps of 1 rank between two cards.
The cards belonging to that straight will be marked as selected in the out_selection array.
- Parameters
-
| played | Array of pointers to CardObject representing played cards. |
| top | Index of the top of the played stack. |
| min_len | Minimum number of cards required for a straight. |
| out_selection | Output array of bools; set to true for cards in the best straight, false otherwise. |
- Returns
- The number of cards in the best straight found, or 0 if no straight meets min_len.
Definition at line 587 of file hand.c.