From a26c25e9809b261810f189576fd880cb093e39bb Mon Sep 17 00:00:00 2001 From: kremsy Date: Sat, 11 Oct 2014 00:26:46 +0200 Subject: [PATCH] capturestructure fix --- core/Callbacks/Structures/CaptureStructure.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/core/Callbacks/Structures/CaptureStructure.php b/core/Callbacks/Structures/CaptureStructure.php index 480d390e..1ece8802 100644 --- a/core/Callbacks/Structures/CaptureStructure.php +++ b/core/Callbacks/Structures/CaptureStructure.php @@ -3,13 +3,17 @@ namespace ManiaControl\Callbacks\Structures; +use ManiaControl\ManiaControl; use ManiaControl\Players\Player; class CaptureStructure { private $playerArray; + /** @var ManiaControl $maniaControl */ + private $maniaControl; - public function __construct($maniaControl, $data) { - $this->playerArray = $data; + public function __construct(ManiaControl $maniaControl, $data) { + $this->maniaControl = $maniaControl; + $this->playerArray = $data; } /** @@ -23,7 +27,10 @@ class CaptureStructure { * @return Player[] */ public function getPlayerArray() { - //TODO build array with player objects - return $this->playerArray; + $playerArray = array(); + foreach ($this->playerArray as $login) { + $playerArray[$login] = $this->maniaControl->getPlayerManager()->getPlayer($this->playerArray); + } + return $playerArray; } } \ No newline at end of file