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

#include "flop.h"

void pokerFlopInit(poker_t *poker) {
  uint8_t count;

  if(poker->round == POKER_ROUND_BET0) {
    printf("Poker Flop Start\n");
    poker->round = POKER_ROUND_FLOP;
    count = POKER_FLOP_CARD_COUNT;
  } else if(poker->round == POKER_ROUND_BET1) {
    printf("Poker Turn\n");
    poker->round = POKER_ROUND_TURN;
    count = POKER_TURN_CARD_COUNT;
  } else if(poker->round == POKER_ROUND_BET2) {
    printf("Poker River\n");
    poker->round = POKER_ROUND_RIVER;
    count = POKER_RIVER_CARD_COUNT;
  }

  // Burn and flop.
  pokerDealerBurn(&poker->dealer, 1);
  pokerDealerTurn(&poker->dealer, count);

  pokerRoundBetInit(poker);
}