2014-10-10 16:19:46 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace ManiaControl\Callbacks\Structures;
|
|
|
|
|
2014-10-11 00:26:46 +02:00
|
|
|
use ManiaControl\ManiaControl;
|
2014-10-10 16:19:46 +02:00
|
|
|
use ManiaControl\Players\Player;
|
|
|
|
|
2015-06-18 17:12:44 +02:00
|
|
|
/**
|
|
|
|
* Structure Class for the Capture Callback
|
|
|
|
*
|
|
|
|
* @author ManiaControl Team <mail@maniacontrol.com>
|
2017-02-04 11:49:23 +01:00
|
|
|
* @copyright 2014-2017 ManiaControl Team
|
2015-06-18 17:12:44 +02:00
|
|
|
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
2017-04-04 19:40:19 +02:00
|
|
|
*
|
|
|
|
* @deprecated see Capture Structure
|
2015-06-18 17:12:44 +02:00
|
|
|
*/
|
2014-10-10 16:19:46 +02:00
|
|
|
class CaptureStructure {
|
2014-10-24 20:20:12 +02:00
|
|
|
/*
|
|
|
|
* Private properties
|
|
|
|
*/
|
2014-10-10 16:19:46 +02:00
|
|
|
private $playerArray;
|
2014-10-11 00:26:46 +02:00
|
|
|
/** @var ManiaControl $maniaControl */
|
|
|
|
private $maniaControl;
|
2014-10-10 16:19:46 +02:00
|
|
|
|
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-10 16:19:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-10-24 20:20:12 +02:00
|
|
|
* Get the logins
|
|
|
|
*
|
|
|
|
* @return array
|
2014-10-10 16:19:46 +02:00
|
|
|
*/
|
|
|
|
public function getLoginArray() {
|
|
|
|
return $this->playerArray;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-10-24 20:20:12 +02:00
|
|
|
* Get the players
|
|
|
|
*
|
2014-10-10 16:19:46 +02:00
|
|
|
* @return Player[]
|
|
|
|
*/
|
|
|
|
public function getPlayerArray() {
|
2014-10-11 00:26:46 +02:00
|
|
|
$playerArray = array();
|
|
|
|
foreach ($this->playerArray as $login) {
|
2014-12-21 23:21:59 +01:00
|
|
|
$player = $this->maniaControl->getPlayerManager()->getPlayer($login);
|
2015-06-18 17:12:44 +02:00
|
|
|
if ($player) {
|
2014-12-21 23:21:59 +01:00
|
|
|
$playerArray[$login] = $player;
|
|
|
|
}
|
2014-10-11 00:26:46 +02:00
|
|
|
}
|
|
|
|
return $playerArray;
|
2014-10-10 16:19:46 +02:00
|
|
|
}
|
2014-10-24 20:20:12 +02:00
|
|
|
}
|