trueskill/src/RatingContainer.php

39 lines
844 B
PHP
Raw Normal View History

<?php namespace Moserware\Skills;
class RatingContainer
{
private $_playerToRating;
public function __construct()
{
$this->_playerToRating = new HashMap();
}
public function &getRating(Player &$player)
{
2010-09-30 12:25:31 +00:00
$rating = &$this->_playerToRating->getValue($player);
return $rating;
}
public function setRating(Player &$player, Rating $rating)
{
return $this->_playerToRating->setValue($player, $rating);
}
public function &getAllPlayers()
{
$allPlayers = &$this->_playerToRating->getAllKeys();
return $allPlayers;
}
public function &getAllRatings()
{
$allRatings = &$this->_playerToRating->getAllValues();
return $allRatings;
}
public function count()
{
return $this->_playerToRating->count();
}
}