TrackManiaControl/core/Callbacks/Structures/ArmorEmptyStructure.php

87 lines
1.7 KiB
PHP
Raw Normal View History

<?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
*/
class ArmorEmptyStructure {
2014-10-24 20:20:12 +02:00
/*
* Private properties
*/
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;
$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
*
* @return Player
*/
public function getShooter() {
2014-10-24 20:20:12 +02:00
return $this->maniaControl->getPlayerManager()->getPlayer($this->shooter);
}
/**
2014-10-24 20:20:12 +02:00
* Get the victim
*
* @return Player
*/
public function getVictim() {
2014-10-24 20:20:12 +02:00
return $this->maniaControl->getPlayerManager()->getPlayer($this->victim);
}
/**
2014-10-24 20:20:12 +02:00
* Get the damage
*
* @return int
*/
public function getDamage() {
return $this->damage;
}
/**
2014-10-24 20:20:12 +02:00
* Get the shooter points
*
* @return int
*/
public function getShooterPoints() {
return $this->shooterPoints;
}
/**
2014-10-24 20:20:12 +02:00
* Get the weapon
*
* @return int
*/
2014-10-24 20:20:12 +02:00
public function getWeapon() {
// TODO: any way of returning type "Weapon?"
return $this->weapon;
}
2014-10-24 20:20:12 +02:00
}