2017-04-13 19:14:23 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace ManiaControl\Callbacks\Structures\Common;
|
|
|
|
|
|
|
|
|
|
|
|
use ManiaControl\ManiaControl;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Structure Class for the Player Added and Removed Structure Callback
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
* @author ManiaControl Team <mail@maniacontrol.com>
|
|
|
|
* @copyright 2014-2017 ManiaControl Team
|
|
|
|
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
|
|
|
*/
|
|
|
|
class BasePlayerTimeStructure extends BaseTimeStructure {
|
2017-04-13 19:24:01 +02:00
|
|
|
protected $login;
|
2017-04-13 19:14:23 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Construct a new On Hit Structure
|
|
|
|
*
|
|
|
|
* @param ManiaControl $maniaControl
|
|
|
|
* @param array $data
|
|
|
|
*/
|
|
|
|
public function __construct(ManiaControl $maniaControl, $data) {
|
|
|
|
parent::__construct($maniaControl, $data);
|
2017-04-13 19:24:01 +02:00
|
|
|
|
|
|
|
$this->login = $this->getPlainJsonObject()->login;
|
2017-04-13 19:14:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the Player Object
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
* @return \ManiaControl\Players\Player
|
|
|
|
*/
|
|
|
|
public function getPlayer() {
|
2017-04-13 19:24:01 +02:00
|
|
|
return $this->maniaControl->getPlayerManager()->getPlayer($this->login);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the Login of the Player
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getLogin() {
|
|
|
|
return $this->login;
|
2017-04-13 19:14:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|