mirror of
				https://github.com/furyfire/trueskill.git
				synced 2025-11-04 10:12:28 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			40 lines
		
	
	
		
			845 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			845 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php namespace Moserware\Skills;
 | 
						|
 | 
						|
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();
 | 
						|
    }
 | 
						|
}
 |