added jsonserializable interface / trait
This commit is contained in:
@ -10,6 +10,8 @@ use ManiaControl\Players\Player;
|
||||
* @author ManiaControl Team <mail@maniacontrol.com>
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*
|
||||
* @deprecated see OnArmorEmptyStructure
|
||||
*/
|
||||
class ArmorEmptyStructure {
|
||||
/*
|
||||
|
@ -11,6 +11,8 @@ use ManiaControl\Players\Player;
|
||||
* @author ManiaControl Team <mail@maniacontrol.com>
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*
|
||||
* @deprecated see Capture Structure
|
||||
*/
|
||||
class CaptureStructure {
|
||||
/*
|
||||
|
@ -3,6 +3,8 @@
|
||||
namespace ManiaControl\Callbacks\Structures\Common;
|
||||
|
||||
|
||||
use ManiaControl\General\JsonSerializable;
|
||||
use ManiaControl\General\JsonSerializeTrait;
|
||||
use ManiaControl\General\UsageInformationAble;
|
||||
use ManiaControl\General\UsageInformationTrait;
|
||||
use ManiaControl\ManiaControl;
|
||||
@ -14,8 +16,8 @@ use ManiaControl\ManiaControl;
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
abstract class BaseStructure implements UsageInformationAble {
|
||||
use UsageInformationTrait;
|
||||
abstract class BaseStructure implements UsageInformationAble, JsonSerializable {
|
||||
use UsageInformationTrait, JsonSerializeTrait;
|
||||
|
||||
/** @var ManiaControl $maniaControl */
|
||||
protected $maniaControl;
|
||||
|
@ -5,6 +5,8 @@ namespace ManiaControl\Callbacks\Structures\Common;
|
||||
|
||||
use ManiaControl\Callbacks\Structures\Common\Models\CommonPlayerScore;
|
||||
use ManiaControl\Callbacks\Structures\ShootMania\Models\TeamScore;
|
||||
use ManiaControl\General\JsonSerializable;
|
||||
use ManiaControl\General\JsonSerializeTrait;
|
||||
use ManiaControl\ManiaControl;
|
||||
|
||||
/**
|
||||
@ -43,7 +45,7 @@ class CommonScoresStructure extends BaseStructure {
|
||||
$teamScore = new \ManiaControl\Callbacks\Structures\ShootMania\Models\TeamScore();
|
||||
}
|
||||
|
||||
$teamScore->setId($team->id);
|
||||
$teamScore->setTeamId($team->id);
|
||||
$teamScore->setName($team->name);
|
||||
$teamScore->setRoundPoints($team->roundpoints);
|
||||
$teamScore->setMatchPoints($team->matchpoints);
|
||||
|
@ -3,12 +3,21 @@
|
||||
namespace ManiaControl\Callbacks\Structures\Common\Models;
|
||||
|
||||
|
||||
use ManiaControl\General\JsonSerializable;
|
||||
use ManiaControl\General\JsonSerializeTrait;
|
||||
use ManiaControl\General\UsageInformationAble;
|
||||
use ManiaControl\General\UsageInformationTrait;
|
||||
use ManiaControl\Players\Player;
|
||||
|
||||
class CommonPlayerScore implements UsageInformationAble {
|
||||
use UsageInformationTrait;
|
||||
/**
|
||||
* Common PlayerStructure Model
|
||||
*
|
||||
* @author ManiaControl Team <mail@maniacontrol.com>
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class CommonPlayerScore implements UsageInformationAble, JsonSerializable {
|
||||
use UsageInformationTrait, JsonSerializeTrait;
|
||||
|
||||
protected $player;
|
||||
protected $rank;
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
namespace ManiaControl\Callbacks\Structures\Common\Models;
|
||||
|
||||
use ManiaControl\General\JsonSerializable;
|
||||
use ManiaControl\General\JsonSerializeTrait;
|
||||
use ManiaControl\General\UsageInformationAble;
|
||||
use ManiaControl\General\UsageInformationTrait;
|
||||
|
||||
@ -12,10 +14,10 @@ use ManiaControl\General\UsageInformationTrait;
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class CommonTeamScore implements UsageInformationAble {
|
||||
use UsageInformationTrait;
|
||||
class CommonTeamScore implements UsageInformationAble, JsonSerializable {
|
||||
use UsageInformationTrait, JsonSerializeTrait;
|
||||
|
||||
private $id;
|
||||
private $teamId;
|
||||
private $name;
|
||||
private $roundPoints;
|
||||
private $mapPoints;
|
||||
@ -24,15 +26,15 @@ class CommonTeamScore implements UsageInformationAble {
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
public function getTeamId() {
|
||||
return $this->teamId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $id
|
||||
*/
|
||||
public function setId($id) {
|
||||
$this->id = $id;
|
||||
public function setTeamId($id) {
|
||||
$this->teamId = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -11,6 +11,8 @@ use ManiaControl\Players\Player;
|
||||
* @author ManiaControl Team <mail@maniacontrol.com>
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*
|
||||
* @deprecated see OnNearMissStructure
|
||||
*/
|
||||
class NearMissStructure {
|
||||
/*
|
||||
|
@ -11,6 +11,8 @@ use ManiaControl\Players\Player;
|
||||
* @author ManiaControl Team <mail@maniacontrol.com>
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*
|
||||
* @deprecated see OnPlayerHitStructure
|
||||
*/
|
||||
class PlayerHitStructure {
|
||||
/*
|
||||
|
Reference in New Issue
Block a user