mirror of
				https://github.com/furyfire/trueskill.git
				synced 2025-11-04 10:12:28 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			23 lines
		
	
	
		
			549 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			549 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace Moserware\Skills;
 | 
						|
 | 
						|
/**
 | 
						|
 * Helper class to sort ranks in non-decreasing order.
 | 
						|
 */
 | 
						|
class RankSorter
 | 
						|
{
 | 
						|
    /**
 | 
						|
     * Performs an in-place sort of the items in according to the ranks in non-decreasing order.
 | 
						|
     * 
 | 
						|
     * @param $items The items to sort according to the order specified by ranks.
 | 
						|
     * @param $ranks The ranks for each item where 1 is first place.
 | 
						|
     */
 | 
						|
    public static function sort(array &$teams, array &$teamRanks)
 | 
						|
    {        
 | 
						|
        array_multisort($teamRanks, $teams);
 | 
						|
        return $teams;
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
?>
 |