doc update

This commit is contained in:
kremsy
2017-04-07 23:26:35 +02:00
parent 782d8b50e8
commit fa4c16e659
47 changed files with 360 additions and 183 deletions

View File

@ -1,31 +1,40 @@
<?php
/**
* Created by PhpStorm.
* User: Lukas
* Date: 07. Apr. 2017
* Time: 17:56
*/
namespace ManiaControl\Callbacks\Structures\Common;
use ManiaControl\ManiaControl;
/**
* Base Structure Class for all Callbacks using a Response Id
*
* @api
* @author ManiaControl Team <mail@maniacontrol.com>
* @copyright 2014-2017 ManiaControl Team
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
class BaseResponseStructure extends BaseStructure {
protected $responseId;
/**
* BaseResponseStructure constructor.
*
* @param \ManiaControl\ManiaControl $maniaControl
* @param $data
*/
public function __construct(ManiaControl $maniaControl, $data) {
parent::__construct($maniaControl, $data);
$this->responseId = $this->getPlainJsonObject()->responseid;
}
/**
* Get the Response Id
*
* @api
* @return string
*/
public function getResponseId() {
return $this->responseId;
}
public function __construct(ManiaControl $maniaControl, $data) {
parent::__construct($maniaControl, $data);
$this->responseId = $this->getPlainJsonObject()->responseid;
}
}

View File

@ -12,6 +12,7 @@ use ManiaControl\ManiaControl;
/**
* Base Structure of all Callback Structures
*
* @api
* @author ManiaControl Team <mail@maniacontrol.com>
* @copyright 2014-2017 ManiaControl Team
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
@ -23,6 +24,12 @@ abstract class BaseStructure implements UsageInformationAble, JsonSerializable {
protected $maniaControl;
private $plainJsonObject;
/**
* BaseStructure constructor.
*
* @param \ManiaControl\ManiaControl $maniaControl
* @param $data
*/
protected function __construct(ManiaControl $maniaControl, $data) {
$this->maniaControl = $maniaControl;
$this->plainJsonObject = json_decode($data[0]);
@ -30,6 +37,8 @@ abstract class BaseStructure implements UsageInformationAble, JsonSerializable {
/**
* Gets the Plain Json
*
* @api
*/
public function getPlainJsonObject() {
return $this->plainJsonObject;

View File

@ -12,6 +12,7 @@ use ManiaControl\ManiaControl;
/**
* Structure Class for the OnScores Structure Callback
*
* @api
* @author ManiaControl Team <mail@maniacontrol.com>
* @copyright 2014-2017 ManiaControl Team
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
@ -24,7 +25,12 @@ class CommonScoresStructure extends BaseResponseStructure {
protected $teamScores = array();
protected $playerScores = array();
//TODO test
/**
* CommonScoresStructure constructor.
*
* @param \ManiaControl\ManiaControl $maniaControl
* @param $data
*/
public function __construct(ManiaControl $maniaControl, $data) {
parent::__construct($maniaControl, $data);
@ -56,6 +62,7 @@ class CommonScoresStructure extends BaseResponseStructure {
/**
* Get the Winner Player Object
*
* @api
* @return \ManiaControl\Players\Player
*/
public function getWinnerPlayer() {
@ -65,6 +72,7 @@ class CommonScoresStructure extends BaseResponseStructure {
/**
* < Current progress of the match. Can be "" | "EndRound" | "EndMap" | "EndMatch"
*
* @api
* @return string
*/
public function getSection() {
@ -74,6 +82,7 @@ class CommonScoresStructure extends BaseResponseStructure {
/**
* Returns if the GameMode uses Teams or not
*
* @api
* @return boolean
*/
public function getUseTeams() {
@ -83,6 +92,7 @@ class CommonScoresStructure extends BaseResponseStructure {
/**
* Get the Winner Team Id
*
* @api
* @return int
*/
public function getWinnerTeamId() {
@ -92,6 +102,7 @@ class CommonScoresStructure extends BaseResponseStructure {
/**
* Returns the TeamScores
*
* @api
* @return TeamScore[]
*/
public function getTeamScores() {
@ -101,6 +112,7 @@ class CommonScoresStructure extends BaseResponseStructure {
/**
* Get the Player Scores
*
* @api
* @return CommonPlayerScore[]
*/
public function getPlayerScores() {

View File

@ -12,6 +12,7 @@ use ManiaControl\Players\Player;
/**
* Common PlayerStructure Model
*
* @api
* @author ManiaControl Team <mail@maniacontrol.com>
* @copyright 2014-2017 ManiaControl Team
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
@ -27,6 +28,7 @@ class CommonPlayerScore implements UsageInformationAble, JsonSerializable {
/**
* Returns the Player
*
* @api
* @return \ManiaControl\Players\Player
*/
public function getPlayer() {
@ -34,6 +36,9 @@ class CommonPlayerScore implements UsageInformationAble, JsonSerializable {
}
/**
* Returns the Player
*
* @api
* @param \ManiaControl\Players\Player $player
*/
public function setPlayer(Player $player) {
@ -43,6 +48,7 @@ class CommonPlayerScore implements UsageInformationAble, JsonSerializable {
/**
* Returns the Rank
*
* @api
* @return int
*/
public function getRank() {
@ -52,6 +58,7 @@ class CommonPlayerScore implements UsageInformationAble, JsonSerializable {
/**
* Sets the Rank
*
* @api
* @param int $rank
*/
public function setRank($rank) {
@ -61,6 +68,7 @@ class CommonPlayerScore implements UsageInformationAble, JsonSerializable {
/**
* Gets the Round Points
*
* @api
* @return int
*/
public function getRoundPoints() {
@ -70,6 +78,7 @@ class CommonPlayerScore implements UsageInformationAble, JsonSerializable {
/**
* Sets the RoundPoints
*
* @api
* @param int $roundPoints
*/
public function setRoundPoints($roundPoints) {
@ -79,6 +88,7 @@ class CommonPlayerScore implements UsageInformationAble, JsonSerializable {
/**
* Gets the Map Points
*
* @api
* @return int
*/
public function getMapPoints() {
@ -88,6 +98,7 @@ class CommonPlayerScore implements UsageInformationAble, JsonSerializable {
/**
* Sets the Map Points
*
* @api
* @param int $mapPoints
*/
public function setMapPoints($mapPoints) {

View File

@ -10,6 +10,7 @@ use ManiaControl\General\UsageInformationTrait;
/**
* TeamScore Model
*
* @api
* @author ManiaControl Team <mail@maniacontrol.com>
* @copyright 2014-2017 ManiaControl Team
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
@ -24,6 +25,9 @@ class CommonTeamScore implements UsageInformationAble, JsonSerializable {
private $matchPoints;
/**
* Get the Team Id
*
* @api
* @return mixed
*/
public function getTeamId() {
@ -31,6 +35,9 @@ class CommonTeamScore implements UsageInformationAble, JsonSerializable {
}
/**
* Sets the TeamId
*
* @api
* @param mixed $id
*/
public function setTeamId($id) {
@ -38,13 +45,19 @@ class CommonTeamScore implements UsageInformationAble, JsonSerializable {
}
/**
* @return mixed
* Gets the Name
*
* @api
* @return string
*/
public function getName() {
return $this->name;
}
/**
* Sets the Name
*
* @api
* @param mixed $name
*/
public function setName($name) {
@ -52,6 +65,9 @@ class CommonTeamScore implements UsageInformationAble, JsonSerializable {
}
/**
* Gets the Round Points
*
* @api
* @return mixed
*/
public function getRoundPoints() {
@ -59,6 +75,9 @@ class CommonTeamScore implements UsageInformationAble, JsonSerializable {
}
/**
* Sets the Round Points
*
* @api
* @param mixed $roundPoints
*/
public function setRoundPoints($roundPoints) {
@ -66,6 +85,9 @@ class CommonTeamScore implements UsageInformationAble, JsonSerializable {
}
/**
* Gets the Map Points
*
* @api
* @return mixed
*/
public function getMapPoints() {
@ -73,6 +95,9 @@ class CommonTeamScore implements UsageInformationAble, JsonSerializable {
}
/**
* Sets the Mappoints
*
* @api
* @param mixed $mapPoints
*/
public function setMapPoints($mapPoints) {
@ -80,6 +105,9 @@ class CommonTeamScore implements UsageInformationAble, JsonSerializable {
}
/**
* Gets the Matchpoints
*
* @api
* @return mixed
*/
public function getMatchPoints() {
@ -87,6 +115,9 @@ class CommonTeamScore implements UsageInformationAble, JsonSerializable {
}
/**
* Sets the Match Points
*
* @api
* @param mixed $matchPoints
*/
public function setMatchPoints($matchPoints) {

View File

@ -9,6 +9,7 @@ use ManiaControl\ManiaControl;
/**
* Structure Class for the StatusCallback Structure Callback
*
* @api
* @author ManiaControl Team <mail@maniacontrol.com>
* @copyright 2014-2017 ManiaControl Team
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
@ -31,6 +32,7 @@ class StatusCallbackStructure extends BaseResponseStructure {
/**
* True if the Status (Like Combo Pause or Warmup) is Ongoing
*
* @api
* @return boolean
*/
public function getActive() {