new Match(round, matchNumber, players)
Create a new match.
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
round |
Number | The round number for the match. |
||
matchNumber |
Number | The match number. |
||
players |
Array.<Player> |
<nullable> |
null | Array of players for the match. |
Members
-
active :Boolean
-
The status of the match.
Type:
- Boolean
- Default Value:
-
- false
-
draws :Number
-
Number of draws.
Type:
- Number
- Default Value:
-
- 0
-
<nullable> loserPath :Match
-
Next match for the loser.
Used in elimination formats.Type:
- Default Value:
-
- null
-
matchNumber :Number
-
Match number.
Type:
- Number
-
<nullable> playerOne :Player
-
Player number one in the match.
If null, the player has not been determined.Type:
- Default Value:
-
- null
-
playerOneWins :Number
-
Number of wins for player one.
Type:
- Number
- Default Value:
-
- 0
-
<nullable> playerTwo :Player
-
Player number two in the match.
If null, the player has not been determined.Type:
- Default Value:
-
- null
-
playerTwoWins :Number
-
Number of wins for player two.
Type:
- Number
- Default Value:
-
- 0
-
round :Number
-
Round number for the match.
Type:
- Number
-
<nullable> winnerPath :Match
-
Next match for the winner.
Used in elimination formats.Type:
- Default Value:
-
- null
Methods
-
assignBye(player, wv)
-
Assign a bye to a player.
Parameters:
Name Type Description player
1 | 2 Which player in the match gets a bye.
wv
Number The value of a win.
-
resultForPlayers(wv, lv, dv)
-
Updates player values for a result.
Parameters:
Name Type Description wv
Number The value of a win.
lv
Number The value of a loss.
dv
Number The value of a draw.