Constructor Summary
Public Constructor | ||
public |
constructor(players: Player[], options: Object) Initializes a new instance of the |
Member Summary
Public Members | ||
public get |
|
|
public get |
|
|
public get |
Determines whether option |
|
public get |
Determines whether option |
|
public get |
startingPoints: Number: * |
Method Summary
Public Methods | ||
public |
getCheckoutHint(points: number, leftThrows: number): Array Calculates step-by-step throws to check-out in the same round. |
|
public |
getPointsByPlayer(player: Player): number Calculates total points for specific player. |
|
public |
getPointsByRound(round: Round): number Calculates points for specific round. |
|
public |
Represents single |
Inherited Summary
From class DartsBaseGame | ||
public get |
currentPlayer: Player: * |
|
public get |
currentRound: Round: * |
|
public get |
|
|
public get |
|
|
public get |
throwsPerRound: number: * |
|
public |
Adds a player to the game. |
|
public |
addPlayers(players: Player[]) Add multiple players to the game. |
|
public |
invalidateRound(round: Round) Invalidates specific round. |
|
public |
invalidateThrow(dartsThrow: Throw) Invalidates specific |
|
public |
nextPlayer(): Player Sets |
|
public |
Creates new instance of the |
|
public |
roundsByPlayer(player: Player): Round[] |
|
public |
Represents single |
|
public |
throwsByPlayer(player: Player): Throw[] |
Public Constructors
public constructor(players: Player[], options: Object) source
Initializes a new instance of the Darts501Game
class.
Override:
DartsBaseGame#constructorExample:
// Creating the new instance
var game = new Darts501Game([new Player({name: 'Player 1'}), new Player({name: 'Player 2'})]);
Public Members
Public Methods
public getCheckoutHint(points: number, leftThrows: number): Array source
Calculates step-by-step throws to check-out in the same round.
public getPointsByPlayer(player: Player): number source
Calculates total points for specific player.
Params:
Name | Type | Attribute | Description |
player | Player | Instance of the |
public getPointsByRound(round: Round): number source
Calculates points for specific round.
Params:
Name | Type | Attribute | Description |
round | Round | Round instance. |
public throw(num: number, multiplier: number): Throw source
Represents single throw
.