From 08307d62adaf6d5499681ff84f9dd257a0d6cf0d Mon Sep 17 00:00:00 2001 From: theturtlemafia Date: Sat, 2 Aug 2025 12:25:31 -0400 Subject: [PATCH] code review feedback --- include/joker.h | 3 ++- source/game.c | 50 +++++++++++++++++++++--------------------- source/joker_effects.c | 2 -- 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/include/joker.h b/include/joker.h index a428f25..c3d173f 100644 --- a/include/joker.h +++ b/include/joker.h @@ -29,6 +29,7 @@ #define DEFAULT_JOKER_ID 0 #define GREEDY_JOKER_ID 1 // This is just an example to show the patern of making joker IDs +#define JOKER_STENCIL_ID 16 typedef struct { @@ -39,7 +40,7 @@ typedef struct bool processed; } Joker; -typedef struct JokerObject // copy of CardObject in card.h +typedef struct JokerObject { Joker *joker; SpriteObject* sprite_object; diff --git a/source/game.c b/source/game.c index 9323660..9e5c7b6 100644 --- a/source/game.c +++ b/source/game.c @@ -139,6 +139,31 @@ static inline Card *discard_pop() return discard_pile[discard_top--]; } +// get-functions, for other files to view game state (mainly for jokers) +CardObject **get_hand_array(void) { + return hand; +} + +int get_hand_top(void) { + return hand_top; +} + +CardObject **get_played_array(void) { + return played; +} + +int get_played_top(void) { + return played_top; +} + +JokerObject **get_jokers(void) { + return jokers; +} + +int get_jokers_top(void) { + return jokers_top; +} + // Consts // Rects left top right bottom @@ -214,31 +239,6 @@ static const Rect SHOP_REROLL_RECT = {88, 96, UNDEFINED, UNDEFI #define PITCH_STEP_UNDISCARD_SFX 2*PITCH_STEP_DRAW_SFX // Naming the stage where cards return from the discard pile to the deck "undiscard" -// get-functions, for other files to view game state (mainly for jokers) -CardObject **get_hand_array(void) { - return hand; -} - -int get_hand_top(void) { - return hand_top; -} - -CardObject **get_played_array(void) { - return played; -} - -int get_played_top(void) { - return played_top; -} - -JokerObject **get_jokers(void) { - return jokers; -} - -int get_jokers_top(void) { - return jokers_top; -} - // General functions void set_seed(int seed) { diff --git a/source/joker_effects.c b/source/joker_effects.c index 1bd8b7d..9403fff 100644 --- a/source/joker_effects.c +++ b/source/joker_effects.c @@ -3,8 +3,6 @@ #include "hand_analysis.h" #include -static const int JOKER_STENCIL_ID = 16; - static JokerEffect default_joker_effect(Joker *joker, Card *scored_card) { JokerEffect effect = {0}; if (scored_card == NULL) effect.mult = 4;