phpdoc & formatting improvements
This commit is contained in:
@ -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,8 +17,14 @@ class ArmorEmptyStructure {
|
||||
/** @var ManiaControl $maniaControl */
|
||||
private $maniaControl;
|
||||
|
||||
public function __construct(ManiaControl $maniaControl, $data) {
|
||||
$this->maniaControl = $maniaControl;
|
||||
/**
|
||||
* 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];
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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() {
|
||||
@ -33,4 +45,4 @@ class CaptureStructure {
|
||||
}
|
||||
return $playerArray;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -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,8 +17,14 @@ class PlayerHitStructure {
|
||||
/** @var ManiaControl $maniaControl */
|
||||
private $maniaControl;
|
||||
|
||||
public function __construct(ManiaControl $maniaControl, $data) {
|
||||
$this->maniaControl = $maniaControl;
|
||||
/**
|
||||
* 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];
|
||||
$this->damage = $data[2];
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,4 +14,4 @@ interface Weapons {
|
||||
const ROCKET = 2;
|
||||
const NUCLEUS = 3;
|
||||
const ARROW = 5;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user