Refactoring structs Part 1

This commit is contained in:
2021-05-20 22:20:52 -07:00
parent 17ddb4246a
commit 9bcf6223b6
56 changed files with 484 additions and 422 deletions

46
temp/action/start.c Normal file
View File

@ -0,0 +1,46 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "start.h"
pokeraction_t actionStart() {
pokeraction_t action = {
.init = &actionStartInit,
.update = &actionStartUpdate,
.dispose = &actionStartDispose
};
return action;
}
void actionStartInit(int32_t index, void *data) {
uint8_t i;
pokerplayer_t *player;
logText("Holdem Starting");
// Prepare the match
GAME_STATE.blindBig = 0;
GAME_STATE.blindSmall = 0;
GAME_STATE.pot = 0;
// Reset the players
for(i = 0; i < POKER_PLAYER_COUNT; i++) {
player = GAME_STATE.players + i;
player->state = 0x00;
player->chips = 0;
}
pokerActionRemove(index);
}
void actionStartUpdate(int32_t index, void *data) {
}
void actionStartDispose(int32_t index, void *data) {
// Begin the first round
pokerActionAdd(actionRound());
}