From 191235b2462ac006e475b47405caac0fe941bca7 Mon Sep 17 00:00:00 2001 From: kremsy Date: Thu, 30 Mar 2017 19:40:10 +0200 Subject: [PATCH] refactored scoressstructures --- .../Structures/ShootMania/OnScoresStructure.php | 12 ------------ .../Structures/TrackMania/OnScoresStructure.php | 13 +------------ 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/core/Callbacks/Structures/ShootMania/OnScoresStructure.php b/core/Callbacks/Structures/ShootMania/OnScoresStructure.php index 1a396224..53334379 100644 --- a/core/Callbacks/Structures/ShootMania/OnScoresStructure.php +++ b/core/Callbacks/Structures/ShootMania/OnScoresStructure.php @@ -23,18 +23,6 @@ class OnScoresStructure extends CommonScoresStructure { $jsonObj = $this->getPlainJsonObject(); - foreach ($jsonObj->teams as $team) { - //if($this instanceof OnScoresStructure) - $teamScore = new TeamScore(); - $teamScore->setId($team->id); - $teamScore->setName($team->name); - $teamScore->setRoundPoints($team->roundpoints); - $teamScore->setMatchPoints($team->matchpoints); - $teamScore->setMapPoints($team->mappoints); - - $this->teamScores[$team->id] = $teamScore; //TODO verify that different teams have different ids - } - foreach ($jsonObj->players as $jsonPlayer) { $playerScore = new PlayerScore(); $playerScore->setPlayer($this->maniaControl->getPlayerManager()->getPlayer($jsonPlayer->login)); diff --git a/core/Callbacks/Structures/TrackMania/OnScoresStructure.php b/core/Callbacks/Structures/TrackMania/OnScoresStructure.php index fac4ad5f..edb1ab66 100644 --- a/core/Callbacks/Structures/TrackMania/OnScoresStructure.php +++ b/core/Callbacks/Structures/TrackMania/OnScoresStructure.php @@ -20,18 +20,7 @@ class OnScoresStructure extends CommonScoresStructure { parent::__construct($maniaControl, $data); $jsonObj = $this->getPlainJsonObject(); - - foreach ($jsonObj->teams as $team) { - $teamScore = new TeamScore(); - $teamScore->setId($team->id); - $teamScore->setName($team->name); - $teamScore->setRoundPoints($team->roundpoints); - $teamScore->setMatchPoints($team->matchpoints); - $teamScore->setMapPoints($team->mappoints); - - $this->teamScores[$team->id] = $teamScore; //TODO verify that different teams have different ids - } - + foreach ($jsonObj->players as $jsonPlayer) { $playerScore = new PlayerScore(); $playerScore->setPlayer($this->maniaControl->getPlayerManager()->getPlayer($jsonPlayer->login));