Esempio n. 1
0
File: Elo.php Progetto: 0ida/fussi
 /**
  * @param Match $match
  * @param int   $participantIndex
  *
  * @return float
  */
 protected function getPointsFormMatch($match, $participantIndex)
 {
     $winner = $match->getWinner();
     if ($winner == $participantIndex) {
         return 1;
     } else {
         if ($match->getWinner() == 0) {
             return 0.5;
         }
     }
     return 0;
 }
Esempio n. 2
0
 public function testWinnerTeamTwo()
 {
     $this->addGameToMatch(2, 5);
     $this->assertEquals(2, $this->match->getWinner());
 }