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

18
games/monopoly/player.c Normal file
View File

@@ -0,0 +1,18 @@
// Implementation of init_player for Monopoly
#include "player.h"
void init_player(Player* p, int id, const char* name, const char* token) {
p->id = id;
p->name = name;
p->token = token;
p->balance = 1500; // Standard starting cash
p->position = 0; // Start at "Go"
p->is_in_jail = false;
p->jail_turns = 0;
p->jail_free_cards = 0;
p->is_bankrupt = false;
p->property_count = 0;
for(int i = 0; i < MAX_PROPERTIES; i++) {
p->properties_owned[i] = -1; // -1 indicates an empty slot
}
}