Clang format and refactor game.h/c + update Bracket Alignment to BlockIndent (#259)
* Refactor and clang-format game.h/c * Updated clang-format AlignAfterOpenBracket: BlockIndent and ColumnLimit: 100 and refactored all files accordingly --------- Co-authored-by: MeirGavish <meir.gavish@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
MeirGavish
Copilot
parent
43d837571e
commit
291edaf4f2
+47
-46
@@ -3,17 +3,33 @@
|
||||
|
||||
#include <tonc.h>
|
||||
|
||||
#define MAX_HAND_SIZE 16
|
||||
#define MAX_DECK_SIZE 52
|
||||
#define MAX_HAND_SIZE 16
|
||||
#define MAX_DECK_SIZE 52
|
||||
#define MAX_JOKERS_HELD_SIZE 5 // This doesn't account for negatives right now.
|
||||
#define MAX_SHOP_JOKERS 2 // TODO: Make this dynamic and allow for other items besides jokers
|
||||
#define MAX_SELECTION_SIZE 5
|
||||
#define FRAMES(x) (((x) + game_speed - 1) / game_speed)
|
||||
#define MAX_SHOP_JOKERS 2 // TODO: Make this dynamic and allow for other items besides jokers
|
||||
#define MAX_SELECTION_SIZE 5
|
||||
#define FRAMES(x) (((x) + game_speed - 1) / game_speed)
|
||||
|
||||
// TODO: Can make these dynamic to support interest-related jokers and vouchers
|
||||
#define MAX_INTEREST 5
|
||||
// TODO: Can make these dynamic to support interest-related jokers and vouchers
|
||||
#define MAX_INTEREST 5
|
||||
#define INTEREST_PER_5 1
|
||||
|
||||
// Input bindings
|
||||
#define SELECT_CARD KEY_A
|
||||
#define DESELECT_CARDS KEY_B
|
||||
#define PEEK_DECK KEY_L // Not implemented
|
||||
#define SORT_HAND KEY_R
|
||||
#define PAUSE_GAME KEY_START // Not implemented
|
||||
#define SELL_KEY KEY_L
|
||||
|
||||
struct List;
|
||||
typedef struct List List;
|
||||
|
||||
// Utility functions for other files
|
||||
typedef struct CardObject CardObject;
|
||||
typedef struct Card Card;
|
||||
typedef struct JokerObject JokerObject;
|
||||
|
||||
enum BackgroundId
|
||||
{
|
||||
BG_NONE,
|
||||
@@ -25,14 +41,6 @@ enum BackgroundId
|
||||
BG_MAIN_MENU
|
||||
};
|
||||
|
||||
// Input bindings
|
||||
#define SELECT_CARD KEY_A
|
||||
#define DESELECT_CARDS KEY_B
|
||||
#define PEEK_DECK KEY_L // Not implemented
|
||||
#define SORT_HAND KEY_R
|
||||
#define PAUSE_GAME KEY_START // Not implemented
|
||||
#define SELL_KEY KEY_L
|
||||
|
||||
// Enum value names in ../include/def_state_info_table.h
|
||||
enum GameState
|
||||
{
|
||||
@@ -47,7 +55,9 @@ enum HandState
|
||||
{
|
||||
HAND_DRAW,
|
||||
HAND_SELECT,
|
||||
HAND_SHUFFLING, // This is actually a misnomer because it's used for the deck, but it mechanically makes sense to be a state of the hand
|
||||
// This is actually a misnomer because it's used for the deck
|
||||
// but it mechanically makes sense to be a state of the hand
|
||||
HAND_SHUFFLING,
|
||||
HAND_DISCARD,
|
||||
HAND_PLAY,
|
||||
HAND_PLAYING
|
||||
@@ -85,7 +95,7 @@ enum HandType
|
||||
FLUSH_FIVE
|
||||
};
|
||||
|
||||
typedef struct
|
||||
typedef struct
|
||||
{
|
||||
int substate;
|
||||
void (*on_init)();
|
||||
@@ -98,40 +108,31 @@ void game_init();
|
||||
void game_update();
|
||||
void game_change_state(enum GameState new_game_state);
|
||||
|
||||
struct List;
|
||||
typedef struct List List;
|
||||
|
||||
// Utility functions for other files
|
||||
typedef struct CardObject CardObject; // forward declaration, actually declared in card.h
|
||||
typedef struct Card Card;
|
||||
typedef struct JokerObject JokerObject;
|
||||
|
||||
CardObject** get_hand_array(void);
|
||||
int get_hand_top(void);
|
||||
int hand_get_size(void);
|
||||
CardObject** get_played_array(void);
|
||||
int get_played_top(void);
|
||||
int get_scored_card_index(void);
|
||||
bool is_joker_owned(int joker_id);
|
||||
bool card_is_face(Card *card);
|
||||
List* get_jokers_list(void);
|
||||
List* get_expired_jokers_list(void);
|
||||
CardObject** get_hand_array(void);
|
||||
int get_hand_top(void);
|
||||
int hand_get_size(void);
|
||||
CardObject** get_played_array(void);
|
||||
int get_played_top(void);
|
||||
int get_scored_card_index(void);
|
||||
bool is_joker_owned(int joker_id);
|
||||
bool card_is_face(Card* card);
|
||||
List* get_jokers_list(void);
|
||||
List* get_expired_jokers_list(void);
|
||||
|
||||
int get_deck_top(void);
|
||||
int get_num_discards_remaining(void);
|
||||
int get_num_hands_remaining(void);
|
||||
|
||||
u32 get_chips(void);
|
||||
void set_chips(u32 new_chips);
|
||||
void display_chips();
|
||||
u32 get_mult(void);
|
||||
void set_mult(u32 new_mult);
|
||||
void display_mult();
|
||||
int get_money(void);
|
||||
void set_money(int new_money);
|
||||
void display_money();
|
||||
void set_retrigger(bool new_retrigger);
|
||||
|
||||
u32 get_chips(void);
|
||||
void set_chips(u32 new_chips);
|
||||
void display_chips();
|
||||
u32 get_mult(void);
|
||||
void set_mult(u32 new_mult);
|
||||
void display_mult();
|
||||
int get_money(void);
|
||||
void set_money(int new_money);
|
||||
void display_money();
|
||||
void set_retrigger(bool new_retrigger);
|
||||
|
||||
int get_game_speed(void);
|
||||
void set_game_speed(int new_game_speed);
|
||||
|
||||
Reference in New Issue
Block a user