No more use of _ to mark private variables.

This commit is contained in:
2023-08-01 14:02:12 +00:00
parent c8c126962d
commit f0aa9413e1
8 changed files with 87 additions and 94 deletions

View File

@ -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;
}
}