phpdoc & formatting improvements

This commit is contained in:
Steffen Schröder
2014-10-24 20:20:12 +02:00
parent 354ab0bcdd
commit b25171657c
7 changed files with 104 additions and 45 deletions

View File

@ -2,55 +2,68 @@
namespace ManiaControl\Callbacks\Structures;
use ManiaControl\ManiaControl;
use ManiaControl\Players\Player;
class NearMissStructure {
/*
* Private properties
*/
private $shooter;
private $victim;
private $distance;
private $weapon;
/** @var ManiaControl $maniaControl */
private $maniaControl;
public function __construct(ManiaControl $maniaControl, $data) {
/**
* Construct a new Near Miss 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->weapon = $data[2];
$this->distance = $data[3];
$this->shooter = $data[0];
$this->victim = $data[1];
$this->weapon = $data[2];
$this->distance = $data[3];
}
/**
* @return Player|null
* Get the shooter
*
* @return Player
*/
public function getShooter() {
$shooter = $this->maniaControl->getPlayerManager()->getPlayer($this->shooter);
return $shooter;
return $this->maniaControl->getPlayerManager()->getPlayer($this->shooter);
}
/**
* @return Player|null
* Get the victim
*
* @return Player
*/
public function getVictim() {
$victim = $this->maniaControl->getPlayerManager()->getPlayer($this->victim);
return $victim;
return $this->maniaControl->getPlayerManager()->getPlayer($this->victim);
}
/**
* @return mixed
* Get the distance
*
* @return float
*/
public function getDistance() {
return $this->distance;
}
/**
* @return mixed
* Get the weapon
*
* @return int
*/
public function getWeapon() {
return $this->weapon;
}
}
}