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

#pragma once
#include "../libs.h"
#include "card.h"
#include "../display/texture.h"
#include "../display/primitive.h"
#include "../display/tileset.h"

/** How many cards a player can hold in their hand */
#define POKER_PLAYER_HAND 2

/** State for whether or not a player has folded */
#define POKER_PLAYER_STATE_FOLDED 0x01

/** State for whether or not a player is showing their hand */
#define POKER_PLAYER_STATE_SHOWING 0x02

/** State for whether or not the player is out */
#define POKER_PLAYER_STATE_OUT 0x04

/** Poker Player State */
typedef struct {
  /** Cards in the players' hand */
  card_t cards[POKER_PLAYER_HAND];
  uint8_t cardCount;

  /** Current State of player */
  uint8_t state;
  
  /** Chips in players' posession */
  uint32_t chips;
  
  /** Current bet in current round player has placed */
  uint32_t currentBet;

  // Rendering assets
  texture_t bodyTexture;
  primitive_t bodyPrimitive;
  texture_t faceTexture;
  primitive_t facePrimitive;
} pokerplayer_t;