implemented all new shootmania callbacks + some refactors

This commit is contained in:
kremsy
2017-04-07 22:30:55 +02:00
parent 287e6316d6
commit 31054d7502
19 changed files with 601 additions and 32 deletions

View File

@ -20,19 +20,20 @@ class OnShootStructure extends BaseStructure {
/**
* @var Player $shooter
*/
private $shooter;
private $shooterLogin;
public function __construct(ManiaControl $maniaControl, $data) {
parent::__construct($maniaControl, $data);
$this->time = $this->getPlainJsonObject()->time;
$this->weapon = $this->getPlainJsonObject()->weapon;
$this->shooter = $this->maniaControl->getPlayerManager()->getPlayer($this->getPlainJsonObject()->shooter);
$this->time = $this->getPlainJsonObject()->time;
$this->weapon = $this->getPlainJsonObject()->weapon;
$this->shooterLogin = $this->getPlainJsonObject()->shooter;
}
/**
* Gets the Time the event Happened
*
* @api
* @return int
*/
public function getTime() {
@ -40,6 +41,10 @@ class OnShootStructure extends BaseStructure {
}
/**
* Gets the Weapon
*
* @api
* @see \ManiaControl\Callbacks\Structures\ShootMania\Models\Weapons
* @return int
*/
public function getWeapon() {
@ -47,15 +52,12 @@ class OnShootStructure extends BaseStructure {
}
/**
* Gets the Shooter
*
* @api
* @return Player
*/
public function getShooter() {
return $this->shooter;
}
/** Dumps the Object with some Information */
public function dump() {
parent::dump();
var_dump("With getShooter() you get a Player Object");
return $this->maniaControl->getPlayerManager()->getPlayer($this->shooterLogin);
}
}