Esempio n. 1
0
 static function getAverageScore($id_set_type)
 {
     $rankings = ModelRanking::get($id_set_type);
     if (count($rankings) == 0) {
         return DEFAULT_SCORE;
     }
     $scores = array();
     foreach ($rankings as $player) {
         $scores[] = $player['score'];
     }
     return Math::array_average($scores);
 }