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

#include "round.h"

void _pokerGameActionRoundOnStart(
  queue_t *queue, queueaction_t *action, uint8_t i
) {
  queueNext(queue);
}

void _pokerGameActionRoundOnEnd(queue_t *queue,queueaction_t *action,uint8_t i){
  pokerdiscussiondata_t data;
  pokergame_t *game = (pokergame_t *)action->data;

  // Start the round
  pokerActionRoundAdd(queue, &game->poker);

  // Speak
  data.poker = game;
  data.reason = POKER_DISCUSSION_REASON_ROUND_START;
  pokerDiscussionQueue(&data);

  // Take the blinds.
  pokerActionBlindsAdd(queue, &game->poker);

  // Speak
  data.reason = POKER_DISCUSSION_REASON_BLINDS_TAKEN;
  pokerDiscussionQueue(&data);

  // Deal
  pokerActionDealAdd(queue, &game->poker);

  // Begin Betting Round
}

queueaction_t * pokerGameActionRoundAdd(pokergame_t *game) {
  queueaction_t *action = pokerGameActionAdd(game);
  action->onStart = &_pokerGameActionRoundOnStart;
  action->onEnd = &_pokerGameActionRoundOnEnd;
  return action;
}