API Docs for:
Show:

turntracker.TurnTrackerView Class

A view that is used for displaying the current state of the game: 1) a table that displays each player's basic information and highlights the current turn, 2) a button to display the game state

Constructor

turntracker.TurnTrackerView

()

Methods

initializePlayer

(
  • playerNumber
  • playerName
  • playerColor
)

sets the name and color of a player in the player table.

Parameters:

  • playerNumber Int

    The player to update

  • playerName String

    the player's name

  • playerColor String

    the player's color

Returns:

void

setClientColor

(
  • color
)

sets the color to display for the local player.

Parameters:

  • color String

    the players specified color

Returns:

void

setController

(
  • controller
)

attaches the controller to the view and builds the view on the page.

Parameters:

  • controller turntracker.Controller

Returns:

void

updatePlayer

(
  • updates
)

updates the information for a player in the player table.

Parameters:

  • updates Object

    an object with the updates for a single player

    • playerIndex Int

      the player to update

    • score Int

      the score

    • highlight Boolean

      whether the player's display box should be highlighted

    • army Boolean

      whether the player has the largest army award

    • road Boolean

      whether the player has the longest road award

Returns:

void

updateStateView

(
  • enable
  • message
)

updates the game state button's message and enabled state

Parameters:

  • enable Boolean

    whether to enable the game state button

  • message String

    the message to display on the game state button

Returns:

void