/**
 * 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();
}