2014-10-10 16:19:46 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace ManiaControl\Callbacks\Structures;
|
|
|
|
|
|
|
|
use ManiaControl\ManiaControl;
|
|
|
|
use ManiaControl\Players\Player;
|
2015-06-18 17:12:44 +02:00
|
|
|
/**
|
|
|
|
* Structure Class for the ArmorEmpty 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 OnArmorEmptyStructure
|
2015-06-18 17:12:44 +02:00
|
|
|
*/
|
2014-10-10 16:19:46 +02:00
|
|
|
class ArmorEmptyStructure {
|
2014-10-24 20:20:12 +02:00
|
|
|
/*
|
|
|
|
* Private properties
|
|
|
|
*/
|
2014-10-10 16:19:46 +02:00
|
|
|
private $shooter;
|
|
|
|
private $victim;
|
|
|
|
private $damage;
|
|
|
|
private $shooterPoints;
|
|
|
|
private $weapon;
|
|
|
|
/** @var ManiaControl $maniaControl */
|
|
|
|
private $maniaControl;
|
|
|
|
|
2014-10-24 20:20:12 +02:00
|
|
|
/**
|
|
|
|
* Construct a new Armor Empty Structure
|
|
|
|
*
|
|
|
|
* @param ManiaControl $maniaControl
|
|
|
|
* @param array $data
|
|
|
|
*/
|
|
|
|
public function __construct(ManiaControl $maniaControl, array $data) {
|
|
|
|
$this->maniaControl = $maniaControl;
|
2014-10-10 16:19:46 +02:00
|
|
|
$this->shooter = $data[0];
|
|
|
|
$this->victim = $data[1];
|
|
|
|
$this->damage = $data[2];
|
|
|
|
$this->weapon = $data[3];
|
|
|
|
$this->shooterPoints = $data[4];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-10-24 20:20:12 +02:00
|
|
|
* Get the shooter
|
|
|
|
*
|
2014-10-10 16:19:46 +02:00
|
|
|
* @return Player
|
|
|
|
*/
|
|
|
|
public function getShooter() {
|
2014-10-24 20:20:12 +02:00
|
|
|
return $this->maniaControl->getPlayerManager()->getPlayer($this->shooter);
|
2014-10-10 16:19:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-10-24 20:20:12 +02:00
|
|
|
* Get the victim
|
|
|
|
*
|
2014-10-10 16:19:46 +02:00
|
|
|
* @return Player
|
|
|
|
*/
|
|
|
|
public function getVictim() {
|
2014-10-24 20:20:12 +02:00
|
|
|
return $this->maniaControl->getPlayerManager()->getPlayer($this->victim);
|
2014-10-10 16:19:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-10-24 20:20:12 +02:00
|
|
|
* Get the damage
|
|
|
|
*
|
2014-10-10 16:19:46 +02:00
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function getDamage() {
|
|
|
|
return $this->damage;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-10-24 20:20:12 +02:00
|
|
|
* Get the shooter points
|
|
|
|
*
|
2014-10-10 16:19:46 +02:00
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function getShooterPoints() {
|
|
|
|
return $this->shooterPoints;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-10-24 20:20:12 +02:00
|
|
|
* Get the weapon
|
|
|
|
*
|
2014-10-10 16:19:46 +02:00
|
|
|
* @return int
|
|
|
|
*/
|
2014-10-24 20:20:12 +02:00
|
|
|
public function getWeapon() {
|
|
|
|
// TODO: any way of returning type "Weapon?"
|
2014-10-10 16:19:46 +02:00
|
|
|
return $this->weapon;
|
|
|
|
}
|
2014-10-24 20:20:12 +02:00
|
|
|
}
|