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

#include "pokerdiscussion.h"

void pokerDiscussionGet(
  pokerdiscussion_t *discussion, pokerdiscussiondata_t *data
) {
  discussion->count = 0;

  switch(data->reason) {
    // Match Start Conversations
    case POKER_DISCUSSION_REASON_MATCH_START:
      discussion->count++;
      discussion->messages[0] = "Match Start";
      break;
    
    // Round Start Conversations
    case POKER_DISCUSSION_REASON_ROUND_START:
      discussion->count++;
      discussion->messages[0] = "Round Start";
      break;

    // Fallback
    default:
      discussion->count++;
      discussion->messages[0] = "Hmm, this seems to be an error message.";
      break;
  }
}

void pokerDiscussionQueue(pokerdiscussiondata_t *data) {
  pokerdiscussion_t discussion;
  uint8_t i;

  pokerDiscussionGet(&discussion, data);

  for(i = 0; i < discussion.count; i++) {
    vnConversationTalk(&data->poker->scene.conversation,
      discussion.messages[i], NULL
    );
  }
}