Ejemplo n.º 1
0
 public function getMainChampions()
 {
     $champions = $this->container->get('lolapi.manager.champion')->getMainChampions($this->item, 12);
     usort($champions, function ($a, $b) {
         $as = new ChampionStats($a, $this->container);
         $bs = new ChampionStats($b, $this->container);
         return $as->getItemUsage('5.14', $this->item) < $bs->getItemUsage('5.14', $this->item);
     });
     return $champions;
 }
Ejemplo n.º 2
0
 public function updateChampions()
 {
     $container = $this->getContainer();
     $manager = $container->get('lolapi.manager.champion');
     $champions = $manager->findAll();
     foreach ($champions as $champion) {
         $stats = new ChampionStats($champion, $container);
         $stats->setRefresh(true);
         foreach (self::$versions as $version) {
             $stats->getPickRate($version);
             $stats->getBanRate($version);
             $stats->getUsage($version);
             $stats->getWinRate($version);
             $stats->getKillsAverage($version);
             $stats->getDeathsAverage($version);
             $stats->getAssistsAverage($version);
             $stats->getKda($version);
             $stats->getGold($version);
             foreach ($stats->getMainItems() as $item) {
                 $stats->getItemUsage($version, $item);
                 $stats->getItemWinrate($version, $item);
             }
         }
     }
 }