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

45
temp/action/deal.c Normal file
View File

@ -0,0 +1,45 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "deal.h"
pokeraction_t actionDeal() {
return (pokeraction_t){
.init = &actionDealInit,
.update = &actionDealUpdate,
.dispose = &actionDealDispose
};
}
void actionDealInit(int32_t index, void *data) {
uint8_t i, j;
pokerplayer_t *player;
logText("Dealing Cards");
for(i = 0; i < 2; i++) {
for(j = 0; j < POKER_PLAYER_COUNT; j++) {
player = GAME_STATE.players + j;
cardDeal(GAME_STATE.deck,
player->cards,
GAME_STATE.deckSize,
player->cardCount
);
GAME_STATE.deckSize--;
player->cardCount++;
}
}
pokerActionRemove(index);
}
void actionDealUpdate(int32_t i, void *data) {
}
void actionDealDispose(int32_t i, void *data) {
int32_t newI = pokerActionAdd(actionAi());
}