/** * Calculates new rankings and returns in RatingsOutput * @return RatingsOutput represents new rankings */ public function calculate() { if ($this->ratingsInput->isNeutralVenue()) { $calculate = new CalculateNeutralVenue($this->ratingsInput); return $calculate->getOutput(); } $calculate = new Calculate($this->ratingsInput); return $calculate->getOutput(); }
/** * Creates new Exchange instance for calculating Exchange amount; passing * in any relevant weightings. */ protected function setExchange() { // create weightings $weightings = array(); $weightings[] = new WeightingHighScore($this->ratingsInput->getTeamAScore(), $this->ratingsInput->getTeamBScore()); if ($this->ratingsInput->isRugbyWorldCup()) { // RWC game $weightings[] = new WeightingWorldCup(); } $this->exchange = new Exchange($this->ratingsGap, $this->matchResult, $weightings); }