mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-11 17:14:13 +00:00
No more use of _ to mark private variables.
This commit is contained in:
@ -7,31 +7,31 @@ namespace DNW\Skills;
|
||||
*/
|
||||
class Player implements ISupportPartialPlay, ISupportPartialUpdate, \Stringable
|
||||
{
|
||||
final const DEFAULT_PARTIAL_PLAY_PERCENTAGE = 1.0; // = 100% play time
|
||||
private const DEFAULT_PARTIAL_PLAY_PERCENTAGE = 1.0; // = 100% play time
|
||||
|
||||
final const DEFAULT_PARTIAL_UPDATE_PERCENTAGE = 1.0;
|
||||
private const DEFAULT_PARTIAL_UPDATE_PERCENTAGE = 1.0;
|
||||
|
||||
private $_PartialPlayPercentage;
|
||||
private $PartialPlayPercentage;
|
||||
|
||||
private $_PartialUpdatePercentage;
|
||||
private $PartialUpdatePercentage;
|
||||
|
||||
/**
|
||||
* Constructs a player.
|
||||
*
|
||||
* @param mixed $_Id The identifier for the player, such as a name.
|
||||
* @param mixed $Id The identifier for the player, such as a name.
|
||||
* @param number $partialPlayPercentage The weight percentage to give this player when calculating a new rank.
|
||||
* @param number $partialUpdatePercentage Indicated how much of a skill update a player should receive where 0 represents no update and 1.0 represents 100% of the update.
|
||||
*/
|
||||
public function __construct(
|
||||
private $_Id,
|
||||
private $Id,
|
||||
$partialPlayPercentage = self::DEFAULT_PARTIAL_PLAY_PERCENTAGE,
|
||||
$partialUpdatePercentage = self::DEFAULT_PARTIAL_UPDATE_PERCENTAGE
|
||||
) {
|
||||
// If they don't want to give a player an id, that's ok...
|
||||
Guard::argumentInRangeInclusive($partialPlayPercentage, 0.0, 1.0, 'partialPlayPercentage');
|
||||
Guard::argumentInRangeInclusive($partialUpdatePercentage, 0, 1.0, 'partialUpdatePercentage');
|
||||
$this->_PartialPlayPercentage = $partialPlayPercentage;
|
||||
$this->_PartialUpdatePercentage = $partialUpdatePercentage;
|
||||
$this->PartialPlayPercentage = $partialPlayPercentage;
|
||||
$this->PartialUpdatePercentage = $partialUpdatePercentage;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -39,7 +39,7 @@ class Player implements ISupportPartialPlay, ISupportPartialUpdate, \Stringable
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->_Id;
|
||||
return $this->Id;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -47,7 +47,7 @@ class Player implements ISupportPartialPlay, ISupportPartialUpdate, \Stringable
|
||||
*/
|
||||
public function getPartialPlayPercentage()
|
||||
{
|
||||
return $this->_PartialPlayPercentage;
|
||||
return $this->PartialPlayPercentage;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -55,11 +55,11 @@ class Player implements ISupportPartialPlay, ISupportPartialUpdate, \Stringable
|
||||
*/
|
||||
public function getPartialUpdatePercentage()
|
||||
{
|
||||
return $this->_PartialUpdatePercentage;
|
||||
return $this->PartialUpdatePercentage;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return (string) $this->_Id;
|
||||
return (string) $this->Id;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user