mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-11 17:14:13 +00:00
Cleanup in src/, adding namespaces, removing php closing tag and general code cleanup
This commit is contained in:
@ -1,9 +1,4 @@
|
||||
<?php
|
||||
namespace Moserware\Skills;
|
||||
|
||||
require_once(dirname(__FILE__) . "/Guard.php");
|
||||
require_once(dirname(__FILE__) . "/ISupportPartialPlay.php");
|
||||
require_once(dirname(__FILE__) . "/ISupportPartialUpdate.php");
|
||||
<?php namespace Moserware\Skills;
|
||||
|
||||
/**
|
||||
* Represents a player who has a Rating.
|
||||
@ -19,7 +14,7 @@ class Player implements ISupportPartialPlay, ISupportPartialUpdate
|
||||
|
||||
/**
|
||||
* Constructs a player.
|
||||
*
|
||||
*
|
||||
* @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.
|
||||
@ -44,7 +39,7 @@ class Player implements ISupportPartialPlay, ISupportPartialUpdate
|
||||
$id = &$this->_Id;
|
||||
return $this->_Id;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Indicates the percent of the time the player should be weighted where 0.0 indicates the player didn't play and 1.0 indicates the player played 100% of the time.
|
||||
*/
|
||||
@ -52,7 +47,7 @@ class Player implements ISupportPartialPlay, ISupportPartialUpdate
|
||||
{
|
||||
return $this->_PartialPlayPercentage;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Indicated how much of a skill update a player should receive where 0.0 represents no update and 1.0 represents 100% of the update.
|
||||
*/
|
||||
@ -60,15 +55,13 @@ class Player implements ISupportPartialPlay, ISupportPartialUpdate
|
||||
{
|
||||
return $this->_PartialUpdatePercentage;
|
||||
}
|
||||
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
if ($this->_Id != null)
|
||||
{
|
||||
if ($this->_Id != null) {
|
||||
return (string)$this->_Id;
|
||||
}
|
||||
|
||||
return parent::__toString();
|
||||
}
|
||||
}
|
||||
?>
|
||||
}
|
Reference in New Issue
Block a user