initial monopoly test

This commit is contained in:
Adolfo Reyna
2026-01-31 09:45:40 -05:00
parent 3a1e278c4c
commit cad1aad2c8
15 changed files with 1152 additions and 4 deletions

41
games/monopoly/player.h Normal file
View File

@@ -0,0 +1,41 @@
#ifndef PLAYER_H
#define PLAYER_H
#include <stdbool.h>
#include "monopoly_board.h"
#define MAX_PLAYERS 4
#define MAX_PROPERTIES 40
typedef struct {
int id; // Player number (0-3)
const char* name; // Player display name
int balance; // Current cash
int position; // Current index on the MONOPOLY_BOARD (0-39)
// Status flags
bool is_in_jail;
int jail_turns; // How many turns they've spent in jail
int jail_free_cards; // Get Out of Jail Free cards
bool is_bankrupt;
// Inventory
int properties_owned[MAX_PROPERTIES]; // Indices of owned tiles
int property_count;
// Piece representation
const char* token; // e.g., "Top Hat", "Iron"
} Player;
/**
* Initializes a player with starting values
*/
#ifdef __cplusplus
extern "C" {
#endif
void init_player(Player* p, int id, const char* name, const char* token);
#ifdef __cplusplus
}
#endif
#endif