Advertisement
I_GRIN_I

Untitled

Jul 25th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.14 KB | None | 0 0
  1. public function write(data_base &$db, $data)
  2.     {
  3.         $is_won = $data["win_state"];
  4.  
  5.         $this->games++;
  6.         $is_won === TRUE and $this->wins++;
  7.         $this->gold += $data["gold"];
  8.         $this->kills += $data["kills"];
  9.         $this->deaths += $data["deaths"];
  10.         $this->assists += $data["assists"];
  11.         $this->last_hits += $data["last_hits"];
  12.        
  13.         $currentGames = $this->games + 1;
  14.         if ($this->games > 2)
  15.         {
  16.             $this->gold_per_min = ($this->gold_per_min + $data["gold_per_min"]) / $currentGames;
  17.             $this->xp_per_minute = ($this->xp_per_minute + $data["xp_per_minute"]) / $currentGames;
  18.             $this->net_worth = ($this->net_worth + $data["net_worth"]) / $currentGamess;
  19.         }
  20.  
  21.         $this->gold_spent += $data["gold_spent"];
  22.         $this->hero_damage += $data["hero_damage"];
  23.         $this->tower_damage += $data["tower_damage"];
  24.         $this->hero_healing += $data["hero_healing"];
  25.         $this->hero_pick_order = round($currentGames / 106, 2);
  26.  
  27.         $this->is_using_plus == 1 and $this->plus_status_verify($db);
  28.  
  29.         $this->update_game_rating($db, $data);
  30.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement