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:
+1
-1
@@ -42,7 +42,7 @@ typedef struct
|
||||
u8 rank;
|
||||
} Card;
|
||||
|
||||
typedef struct
|
||||
typedef struct CardObject
|
||||
{
|
||||
Card *card;
|
||||
SpriteObject *sprite_object;
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user