First TwoPlayerTrueSkillCalculator unit test passed

This commit is contained in:
Jeff Moser
2010-08-28 22:05:41 -04:00
commit 12a02b8403
41 changed files with 1909 additions and 0 deletions

View File

@ -0,0 +1,27 @@
<?php
namespace Moserware\Skills;
/**
* Represents a comparison between two players.
* @internal The actual values for the enum were chosen so that the also correspond to the multiplier for updates to means.
*/
class PairwiseComparison
{
const WIN = 1;
const DRAW = 0;
const LOSE = -1;
public static function getRankFromComparison($comparison)
{
switch ($comparison) {
case PairwiseComparison::WIN:
return array(1,2);
case PairwiseComparison::LOSE:
return array(2,1);
default:
return array(1,1);
}
}
}
?>