/**
 * Copyright (c) 2021 Dominic Masters
 * 
 * This software is released under the MIT License.
 * https://opensource.org/licenses/MIT
 */

#include "ai.h"

pokeraction_t actionAi() {
  return (pokeraction_t){
    .init = &actionAiInit,
    .update = &actionAiUpdate,
    .dispose = &actionAiDispose
  };
}

void actionAiInit(int32_t index, void *data) {
  logText("AI Round start");

  /*
    Current theory for the AI code will be;
    1 - Determine weight of my cards+flop as %
    2 - Determine current bet, compare against [something] and then determine if
        worth the risk. I may need history of the game to make informed decision
  */

  pokerActionRemove(index);
}

void actionAiUpdate(int32_t index, void *data) {
}

void actionAiDispose(int32_t index, void *data) {
  // Do we need to do a flop?
  if(GAME_STATE.cardsFacing < POKER_DEALER_HAND) {
    pokerActionAdd(actionFlop());
  }
}