R/display.R

Defines functions display

Documented in display

#' Display a Poker HUD
#'
#' @param players A list containing objects of the S4 class `player`.
#' @param turn The index of the player who is due to act.
#' @param pot The current size of the pot.
#' @param bets A vector representing the total contribution of each player to the pot.
#'
#' @export
#'
display <- function(players,turn,pot,bets){
  n <- length(players)
  names(bets) <- paste("Player",1:n)
  cat(sep="\n",
    paste("PLAYER",turn,"TO ACT"),
    paste("Pot:",pot),
    paste("Chips:",players[[turn]]@chips)
  )
  cat("Hand: ")
  cat(names(players[[turn]]@hand),sep=", ")
  cat("\n")
  cat("Community: ")
  cat(names(players[[turn]]@community),sep=", ")
  cat("\n")
  print(bets)
}
dfcorbin/pokersim2 documentation built on Jan. 15, 2020, 12:20 a.m.