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
()
Item Index
Methods
initializePlayer
-
playerNumber
-
playerName
-
playerColor
sets the name and color of a player in the player table.
Parameters:
-
playerNumber
IntThe player to update
-
playerName
Stringthe player's name
-
playerColor
Stringthe player's color
Returns:
void
setClientColor
-
color
sets the color to display for the local player.
Parameters:
-
color
Stringthe 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
Objectan object with the updates for a single player
-
playerIndex
Intthe player to update
-
score
Intthe score
-
highlight
Booleanwhether the player's display box should be highlighted
-
army
Booleanwhether the player has the largest army award
-
road
Booleanwhether the player has the longest road award
-
Returns:
void
updateStateView
-
enable
-
message
updates the game state button's message and enabled state
Parameters:
-
enable
Booleanwhether to enable the game state button
-
message
Stringthe message to display on the game state button
Returns:
void