Added 'presence' points to player scoring
The scoring system in the Player class has been updated. Now, players will receive additional 'presence' points for each round they participate in, regardless of the outcome (win, loss, draw, bye or absent). The number of 'presence' points is customizable and defaults to zero if not set.
This commit is contained in:
parent
ff8d372a8f
commit
cb1b5c29be
@ -235,14 +235,18 @@ class Player
|
||||
if ($key < $round || $round == -1) {
|
||||
if ($pairing->Result == Result::WON_BYE) {
|
||||
$points += (isset($custompoints[ 'bye' ])) ? $custompoints[ 'bye' ] : 1;
|
||||
$points += (isset($custompoints[ 'presence' ])) ? $custompoints[ 'presence' ] : 0;
|
||||
} else if ($pairing->Result == Result::ABSENT) {
|
||||
$points += (isset($custompoints[ 'absent' ])) ? $custompoints[ 'absent' ] : 0;
|
||||
} elseif (array_search($pairing->Result, Constants::WON) !== false) {
|
||||
$points += (isset($custompoints[ 'win' ])) ? $custompoints[ 'win' ] : 1;
|
||||
$points += (isset($custompoints[ 'presence' ])) ? $custompoints[ 'presence' ] : 0;
|
||||
} elseif (array_search($pairing->Result, Constants::DRAW) !== false) {
|
||||
$points += (isset($custompoints[ 'draw' ])) ? $custompoints[ 'draw' ] : 0.5;
|
||||
$points += (isset($custompoints[ 'presence' ])) ? $custompoints[ 'presence' ] : 0;
|
||||
} elseif (array_search($pairing->Result, Constants::LOST) !== false) {
|
||||
$points += (isset($custompoints[ 'loss' ])) ? $custompoints[ 'loss' ] : 0;
|
||||
$points += (isset($custompoints[ 'presence' ])) ? $custompoints[ 'presence' ] : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user