2017-03-27 22:21:59 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace ManiaControl\Callbacks\Structures\ShootMania;
|
|
|
|
|
|
|
|
|
2017-03-30 19:49:45 +02:00
|
|
|
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
|
2017-03-27 22:21:59 +02:00
|
|
|
use ManiaControl\ManiaControl;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Structure Class for the OnCustomEvent Structure Callback
|
|
|
|
*
|
2017-04-07 23:26:35 +02:00
|
|
|
* @api
|
2017-03-27 22:21:59 +02:00
|
|
|
* @author ManiaControl Team <mail@maniacontrol.com>
|
|
|
|
* @copyright 2014-2017 ManiaControl Team
|
|
|
|
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
|
|
|
*/
|
|
|
|
class OnActionEvent extends BaseStructure {
|
|
|
|
private $time;
|
|
|
|
private $player;
|
|
|
|
private $actionInput;
|
|
|
|
|
2017-04-07 23:26:35 +02:00
|
|
|
/**
|
|
|
|
* OnActionEvent constructor.
|
|
|
|
*
|
|
|
|
* @param \ManiaControl\ManiaControl $maniaControl
|
|
|
|
* @param $data
|
|
|
|
*/
|
2017-03-27 22:21:59 +02:00
|
|
|
public function __construct(ManiaControl $maniaControl, $data) {
|
|
|
|
parent::__construct($maniaControl, $data);
|
|
|
|
|
|
|
|
$this->time = $this->getPlainJsonObject()->time;
|
|
|
|
$this->actionInput = $this->getPlainJsonObject()->actioninput;
|
|
|
|
|
|
|
|
$this->player = $this->maniaControl->getPlayerManager()->getPlayer($this->getPlainJsonObject()->login);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns Server time when the event occured
|
|
|
|
*
|
2017-04-07 23:26:35 +02:00
|
|
|
* @api
|
2017-03-27 22:21:59 +02:00
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function getTime() {
|
|
|
|
return $this->time;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* < player who triggered the action
|
|
|
|
*
|
2017-04-07 23:26:35 +02:00
|
|
|
* @api
|
2017-03-27 22:21:59 +02:00
|
|
|
* @return \ManiaControl\Players\Player
|
|
|
|
*/
|
|
|
|
public function getPlayer() {
|
|
|
|
return $this->player;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* < The input pressed to trigger the action
|
|
|
|
*
|
2017-04-07 23:26:35 +02:00
|
|
|
* @api
|
2017-03-27 22:21:59 +02:00
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getActionInput() {
|
|
|
|
return $this->actionInput;
|
|
|
|
}
|
|
|
|
}
|