It gets a result... unfortunately it's wrong. But hey, that's progress :) Lots of debugging code left in to make up for a less than ideal debugger

This commit is contained in:
Jeff Moser
2010-10-02 21:15:47 -04:00
parent c22683ab33
commit fc6cd5c961
22 changed files with 145 additions and 70 deletions

View File

@ -2,6 +2,8 @@
namespace Moserware\Skills;
require_once(dirname(__FILE__) . "/HashMap.php");
require_once(dirname(__FILE__) . "/Player.php");
require_once(dirname(__FILE__) . "/Rating.php");
class RatingContainer
{
@ -12,25 +14,27 @@ class RatingContainer
$this->_playerToRating = new HashMap();
}
public function &getRating($player)
public function &getRating(Player &$player)
{
$rating = &$this->_playerToRating->getValue($player);
return $rating;
}
public function setRating($player, $rating)
public function setRating(Player &$player, Rating $rating)
{
return $this->_playerToRating->setValue($player, $rating);
}
public function getAllPlayers()
public function &getAllPlayers()
{
return $this->_playerToRating->getAllKeys();
$allPlayers = &$this->_playerToRating->getAllKeys();
return $allPlayers;
}
public function getAllRatings()
public function &getAllRatings()
{
return $this->_playerToRating->getAllValues();
$allRatings = &$this->_playerToRating->getAllValues();
return $allRatings;
}
public function count()