Moved UnitTests to tests/ and Skills to src/

This commit is contained in:
Alexander Liljengård
2016-05-24 13:53:56 +02:00
parent 11b5033c8a
commit 4ab0c5d719
64 changed files with 0 additions and 0 deletions

45
src/RatingContainer.php Normal file
View File

@ -0,0 +1,45 @@
<?php
namespace Moserware\Skills;
require_once(dirname(__FILE__) . "/HashMap.php");
require_once(dirname(__FILE__) . "/Player.php");
require_once(dirname(__FILE__) . "/Rating.php");
class RatingContainer
{
private $_playerToRating;
public function __construct()
{
$this->_playerToRating = new HashMap();
}
public function &getRating(Player &$player)
{
$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();
}
}
?>