adds jokers 6-16. Extract hand type detection logic from hand_get_type to be used by jokers as well

This commit is contained in:
theturtlemafia
2025-07-28 18:27:48 -04:00
parent 095fb455cc
commit a72458c2c3
6 changed files with 332 additions and 98 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ typedef struct
u8 rank;
} Card;
typedef struct
typedef struct CardObject
{
Card *card;
SpriteObject *sprite_object;
+7
View File
@@ -72,4 +72,11 @@ enum HandType
void game_init();
void game_update();
// Utility functions for other files
typedef struct CardObject CardObject; // forward declaration, actually declared in card.h
CardObject **get_hand_array(void);
CardObject **get_played_array(void);
int get_hand_top(void);
int get_played_top(void);
#endif // GAME_H
+16
View File
@@ -0,0 +1,16 @@
#ifndef HAND_ANALYSIS_H
#define HAND_ANALYSIS_H
#include <tonc.h>
#include "card.h"
void get_hand_distribution(u8 *ranks_out, u8 *suits_out);
void get_played_distribution(u8 *ranks_out, u8 *suits_out);
u8 hand_contains_n_of_a_kind(u8 *ranks);
bool hand_contains_two_pair(u8 *ranks);
bool hand_contains_full_house(u8 *ranks);
bool hand_contains_straight(u8 *ranks);
bool hand_contains_flush(u8 *suits);
#endif