added direct invoke callback for methods
This commit is contained in:
29
core/Callbacks/Structures/Common/BaseResponseStructure.php
Normal file
29
core/Callbacks/Structures/Common/BaseResponseStructure.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Lukas
|
||||
* Date: 07. Apr. 2017
|
||||
* Time: 17:56
|
||||
*/
|
||||
|
||||
namespace ManiaControl\Callbacks\Structures\Common;
|
||||
|
||||
|
||||
use ManiaControl\ManiaControl;
|
||||
|
||||
class BaseResponseStructure extends BaseStructure {
|
||||
protected $responseId;
|
||||
|
||||
/**
|
||||
* Get the Response Id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getResponseId() {
|
||||
return $this->responseId;
|
||||
}
|
||||
|
||||
public function __construct(ManiaControl $maniaControl, $data) {
|
||||
parent::__construct($maniaControl, $data);
|
||||
}
|
||||
}
|
@ -16,8 +16,7 @@ use ManiaControl\ManiaControl;
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class CommonScoresStructure extends BaseStructure {
|
||||
protected $responseId;
|
||||
class CommonScoresStructure extends BaseResponseStructure {
|
||||
protected $section;
|
||||
protected $useTeams;
|
||||
protected $winnerTeam;
|
||||
@ -64,15 +63,6 @@ class CommonScoresStructure extends BaseStructure {
|
||||
return $this->winnerPlayer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Response Id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getResponseId() {
|
||||
return $this->responseId;
|
||||
}
|
||||
|
||||
/**
|
||||
* < Current progress of the match. Can be "" | "EndRound" | "EndMap" | "EndMatch"
|
||||
*
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace ManiaControl\Callbacks\Structures\XmlRpc;
|
||||
|
||||
use ManiaControl\Callbacks\Structures\Common\BaseResponseStructure;
|
||||
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
|
||||
use ManiaControl\ManiaControl;
|
||||
|
||||
@ -12,9 +13,7 @@ use ManiaControl\ManiaControl;
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class CallbacksListStructure extends BaseStructure {
|
||||
/** @var string $responseId */
|
||||
private $responseId;
|
||||
class CallbacksListStructure extends BaseResponseStructure {
|
||||
/** @var array $callbacks */
|
||||
private $callbacks;
|
||||
|
||||
@ -31,14 +30,6 @@ class CallbacksListStructure extends BaseStructure {
|
||||
$this->callbacks = $this->getPlainJsonObject()->callbacks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Response Id //TODO Trait for all Response Ids
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getResponseId() {
|
||||
return $this->responseId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Array of the Callbacks
|
||||
|
Reference in New Issue
Block a user