TrackManiaControl/core/Callbacks/Structures/CaptureStructure.php

49 lines
938 B
PHP
Raw Normal View History

<?php
namespace ManiaControl\Callbacks\Structures;
2014-10-11 00:26:46 +02:00
use ManiaControl\ManiaControl;
use ManiaControl\Players\Player;
class CaptureStructure {
2014-10-24 20:20:12 +02:00
/*
* Private properties
*/
private $playerArray;
2014-10-11 00:26:46 +02:00
/** @var ManiaControl $maniaControl */
private $maniaControl;
2014-10-24 20:20:12 +02:00
/**
* Construct a new Capture Structure
*
* @param ManiaControl $maniaControl
* @param array $data
*/
public function __construct(ManiaControl $maniaControl, array $data) {
2014-10-11 00:26:46 +02:00
$this->maniaControl = $maniaControl;
$this->playerArray = $data;
}
/**
2014-10-24 20:20:12 +02:00
* Get the logins
*
* @return array
*/
public function getLoginArray() {
return $this->playerArray;
}
/**
2014-10-24 20:20:12 +02:00
* Get the players
*
* @return Player[]
*/
public function getPlayerArray() {
2014-10-11 00:26:46 +02:00
$playerArray = array();
foreach ($this->playerArray as $login) {
$playerArray[$login] = $this->maniaControl->getPlayerManager()->getPlayer($this->playerArray);
}
return $playerArray;
}
2014-10-24 20:20:12 +02:00
}