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

30
temp/action/shuffle.c Normal file
View File

@ -0,0 +1,30 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "shuffle.h"
pokeraction_t actionShuffle() {
return (pokeraction_t){
.init = &actionShuffleInit,
.update = &actionShuffleUpdate,
.dispose = &actionShuffleDispose
};
}
void actionShuffleInit(int32_t index, void *data) {
logText("Shuffle Deck");
cardShuffle(GAME_STATE.deck, GAME_STATE.deckSize);
pokerActionRemove(index);
}
void actionShuffleUpdate(int32_t index, void *data) {
}
void actionShuffleDispose(int32_t index, void *data) {
if(((shuffledata_t *)data) != NULL) ((shuffledata_t *)data)->done();
}