capturestructure fix

This commit is contained in:
kremsy 2014-10-11 00:26:46 +02:00
parent 0aa539b00d
commit a26c25e980

View File

@ -3,12 +3,16 @@
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) {
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;
}
}