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

@ -236,7 +236,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
/**
* Closes the widget
*
* @param \ManiaControl\Players\Player $player
* @param Player $player
*/
public function closeWidget(Player $player) {
unset($this->adminListShown[$player->login]);
@ -246,7 +246,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
* Unset the player if he opened another Main Widget
*
* @param Player $player
* @param $openedWidget
* @param string $openedWidget
*/
public function handleWidgetOpened(Player $player, $openedWidget) {
//unset when another main widget got opened

View File

@ -2,11 +2,13 @@
namespace ManiaControl\Callbacks\Structures;
use ManiaControl\ManiaControl;
use ManiaControl\Players\Player;
class ArmorEmptyStructure {
/*
* Private properties
*/
private $shooter;
private $victim;
private $damage;
@ -15,7 +17,13 @@ class ArmorEmptyStructure {
/** @var ManiaControl $maniaControl */
private $maniaControl;
public function __construct(ManiaControl $maniaControl, $data) {
/**
* 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];
@ -25,22 +33,26 @@ class ArmorEmptyStructure {
}
/**
* Get the shooter
*
* @return Player
*/
public function getShooter() {
$shooter = $this->maniaControl->getPlayerManager()->getPlayer($this->shooter);
return $shooter;
return $this->maniaControl->getPlayerManager()->getPlayer($this->shooter);
}
/**
* Get the victim
*
* @return Player
*/
public function getVictim() {
$victim = $this->maniaControl->getPlayerManager()->getPlayer($this->victim);
return $victim;
return $this->maniaControl->getPlayerManager()->getPlayer($this->victim);
}
/**
* Get the damage
*
* @return int
*/
public function getDamage() {
@ -48,6 +60,8 @@ class ArmorEmptyStructure {
}
/**
* Get the shooter points
*
* @return int
*/
public function getShooterPoints() {
@ -55,9 +69,12 @@ class ArmorEmptyStructure {
}
/**
* Get the weapon
*
* @return int
*/
public function getWeapon() { //TODO any way of returning type "Weapon?"
public function getWeapon() {
// TODO: any way of returning type "Weapon?"
return $this->weapon;
}
}

View File

@ -2,28 +2,40 @@
namespace ManiaControl\Callbacks\Structures;
use ManiaControl\ManiaControl;
use ManiaControl\Players\Player;
class CaptureStructure {
/*
* Private properties
*/
private $playerArray;
/** @var ManiaControl $maniaControl */
private $maniaControl;
public function __construct(ManiaControl $maniaControl, $data) {
/**
* Construct a new Capture Structure
*
* @param ManiaControl $maniaControl
* @param array $data
*/
public function __construct(ManiaControl $maniaControl, array $data) {
$this->maniaControl = $maniaControl;
$this->playerArray = $data;
}
/**
* @return mixed
* Get the logins
*
* @return array
*/
public function getLoginArray() {
return $this->playerArray;
}
/**
* Get the players
*
* @return Player[]
*/
public function getPlayerArray() {

View File

@ -2,20 +2,27 @@
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];
@ -24,30 +31,36 @@ class NearMissStructure {
}
/**
* @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;

View File

@ -2,11 +2,13 @@
namespace ManiaControl\Callbacks\Structures;
use ManiaControl\ManiaControl;
use ManiaControl\Players\Player;
class PlayerHitStructure {
/*
* Private properties
*/
private $shooter;
private $victim;
private $damage;
@ -15,7 +17,13 @@ class PlayerHitStructure {
/** @var ManiaControl $maniaControl */
private $maniaControl;
public function __construct(ManiaControl $maniaControl, $data) {
/**
* Construct new Player Hit 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];
@ -25,22 +33,26 @@ class PlayerHitStructure {
}
/**
* @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);
}
/**
* Get the damage
*
* @return int
*/
public function getDamage() {
@ -48,6 +60,8 @@ class PlayerHitStructure {
}
/**
* Get the shooter points
*
* @return int
*/
public function getShooterPoints() {
@ -55,9 +69,12 @@ class PlayerHitStructure {
}
/**
* Get the weapon
*
* @return int
*/
public function getWeapon() { //TODO any way of returning type "Weapon?"
public function getWeapon() {
// TODO: any way of returning type "Weapon?"
return $this->weapon;
}
}