Refactoring structs Part 1
This commit is contained in:
46
temp/action/start.c
Normal file
46
temp/action/start.c
Normal 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());
|
||||
}
|
Reference in New Issue
Block a user