Ejemplo n.º 1
0
Archivo: Elo.php Proyecto: 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;
 }
Ejemplo n.º 2
0
 public function testWinnerTeamTwo()
 {
     $this->addGameToMatch(2, 5);
     $this->assertEquals(2, $this->match->getWinner());
 }