Round
A round in the WOJ game. The standard game is played with two rounds.
Constructor Summary
Public Constructor | ||
public |
constructor(id: number, wheel: Wheel, players: Player[], maxTime: number) |
Member Summary
Public Members | ||
public |
|
|
public get |
|
|
public get |
currentPlayer: Player: * Current player's player object. |
|
public |
|
|
public get |
stats: RoundStats: * Stats for the current round, including spins used, clues answered, and attributes for the player who has the current turn, e.g. |
Private Members | ||
private get |
Current player's score object. |
|
private |
|
|
private |
|
Method Summary
Public Methods | ||
public |
endTurn() End the current players turn, should be called after a spin and validation (if applicable) is complete. |
|
public |
When Spin resulted in a clue or pickCategory was used to set a clue, call this method if the player answered incorrectly, to adjust their score. |
|
public |
pickCategory(column: number): Clue When spin is Player's Choice or Opponent's Choice, use pickCategory, to get the next clue from the specificed category. |
|
public |
reset() Resets the current round by reseting the wheel, board, and player scores. |
|
public |
Spins the wheel and returns the result in a Spin object. |
|
public |
start() Start the WOJ round. |
|
public |
Use a free turn token for the current player. |
|
public |
When Spin resulted in a clue or pickCategory was used to set a clue, call this method if the player answered correctly, to adjust their score. |
Private Methods | ||
private |
Private method to reset the turn: currentSpin and currentClue are set to undefined. |
Public Constructors
Public Members
public get stats: RoundStats: * source
Stats for the current round, including spins used, clues answered, and attributes for the player who has the current turn, e.g. score, tokens.
Private Members
Public Methods
public endTurn() source
End the current players turn, should be called after a spin and validation (if applicable) is complete. This method will switch to the next player and reset the currentSpin and currentClue.
public invalidAnswer() source
When Spin resulted in a clue or pickCategory was used to set a clue, call this method if the player answered incorrectly, to adjust their score.
Throw:
throws error if no clue is set to validate. |
public pickCategory(column: number): Clue source
When spin is Player's Choice or Opponent's Choice, use pickCategory, to get the next clue from the specificed category. This will set the currentClue.
Params:
Name | Type | Attribute | Description |
column | number | column index of the category. |
Throw:
throws error if current spin sector does not permit picking a category, i.e. it is not Player's Choice or Opponents Choice. |
public spin(): Spin source
Spins the wheel and returns the result in a Spin object. If Free Turn, Bankrupt, or Double Score are landed, the players tokens or score is adjusted. If Player's Choice or Opponent's Choice are landed, use pickCategory to get the next clue.
public useToken(): boolean source
Use a free turn token for the current player. A token may be used if the player loses his turn or answers a question incorrectly. A token cannot be used if the player spins free turn.
public validAnswer() source
When Spin resulted in a clue or pickCategory was used to set a clue, call this method if the player answered correctly, to adjust their score.
Throw:
throws error if no clue is set to validate. |
Private Methods
private resetTurn_() source
Private method to reset the turn: currentSpin and currentClue are set to undefined.