FML Update

This commit is contained in:
kremsy
2017-07-02 17:45:32 +02:00
parent c9d96a30b2
commit 22e1e24284
9 changed files with 2141 additions and 6 deletions

View File

@ -0,0 +1,144 @@
<?php
namespace FML\XmlRpc;
/**
* Class representing ShootMania UI Properties
*
* @author steeffeen
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
class SMUIProperties extends UIProperties
{
/**
* @var array $noticesProperties Notices properties
*/
protected $noticesProperties = array();
/**
* @var array $crosshairProperties Crosshair properties
*/
protected $crosshairProperties = array();
/**
* @var array $gaugesProperties Gauges properties
*/
protected $gaugesProperties = array();
/**
* @var array $consumablesProperties Consumables properties
*/
protected $consumablesProperties = array();
/**
* Get the notices visibility
*
* @api
* @return bool
*/
public function getNoticesVisible()
{
return $this->getVisibleProperty($this->noticesProperties);
}
/**
* Set the notices visibility
*
* @api
* @param bool $visible If the notices should be visible
* @return static
*/
public function setNoticesVisible($visible)
{
$this->setVisibleProperty($this->noticesProperties, $visible);
return $this;
}
/**
* Get the crosshair visibility
*
* @api
* @return bool
*/
public function getCrosshairVisible()
{
return $this->getVisibleProperty($this->crosshairProperties);
}
/**
* Set the crosshair visibility
*
* @api
* @param bool $visible If the crosshair should be visible
* @return static
*/
public function setCrosshairVisible($visible)
{
$this->setVisibleProperty($this->crosshairProperties, $visible);
return $this;
}
/**
* Get the gauges visibility
*
* @api
* @return bool
*/
public function getGaugesVisible()
{
return $this->getVisibleProperty($this->gaugesProperties);
}
/**
* Set the gauges visibility
*
* @api
* @param bool $visible If the gauges should be visible
* @return static
*/
public function setGaugesVisible($visible)
{
$this->setVisibleProperty($this->gaugesProperties, $visible);
return $this;
}
/**
* Get the consumables visibility
*
* @api
* @return bool
*/
public function getConsumablesVisible()
{
return $this->getVisibleProperty($this->consumablesProperties);
}
/**
* Set the consumables visibility
*
* @api
* @param bool $visible If the consumables should be visible
* @return static
*/
public function setConsumablesVisible($visible)
{
$this->setVisibleProperty($this->consumablesProperties, $visible);
return $this;
}
/**
* @see UIProperties::getProperties()
*/
protected function getProperties()
{
return array_merge(parent::getProperties(), array(
"notices" => $this->noticesProperties,
"crosshair" => $this->crosshairProperties,
"gauges" => $this->gaugesProperties,
"consumables" => $this->consumablesProperties
));
}
}

View File

@ -0,0 +1,726 @@
<?php
namespace FML\XmlRpc;
/**
* Class representing TrackMania UI Properties
*
* @author steeffeen
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
class TMUIProperties extends UIProperties
{
/**
* @var array $liveInfoProperties Live info properties
*/
protected $liveInfoProperties = array();
/**
* @var array $spectatorInfoProperties Spectator info properties
*/
protected $spectatorInfoProperties = array();
/**
* @var array $opponentsInfoProperties Opponents info properties
*/
protected $opponentsInfoProperties = array();
/**
* @var array $checkpointListProperties Checkpoint list properties
*/
protected $checkpointListProperties = array();
/**
* @var array $roundScoresProperties Round scores properties
*/
protected $roundScoresProperties = array();
/**
* @var array $chronoProperties Chrono properties
*/
protected $chronoProperties = array();
/**
* @var array $speedAndDistanceProperties Speed and distance properties
*/
protected $speedAndDistanceProperties = array();
/**
* @var array $personalBestAndRankProperties Personal best and rank properties
*/
protected $personalBestAndRankProperties = array();
/**
* @var array $positionProperties Position properties
*/
protected $positionProperties = array();
/**
* @var array $checkpointTimeProperties Checkpoint time properties
*/
protected $checkpointTimeProperties = array();
/**
* @var array $warmUpProperties Warm-up properties
*/
protected $warmUpProperties = array();
/**
* @var array $multiLapInfoProperties Multi-lap info properties
*/
protected $multiLapInfoProperties = array();
/**
* @var array $checkpointRankingProperties Checkpoint ranking properties
*/
protected $checkpointRankingProperties = array();
/**
* Get the live info visibility
*
* @api
* @return bool
*/
public function getLiveInfoVisible()
{
return $this->getVisibleProperty($this->liveInfoProperties);
}
/**
* Set the live info visibility
*
* @api
* @param bool $visible If the live info should be visible
* @return static
*/
public function setLiveInfoVisible($visible)
{
$this->setVisibleProperty($this->liveInfoProperties, $visible);
return $this;
}
/**
* Get the live info position
*
* @api
* @return string
*/
public function getLiveInfoPosition()
{
return $this->getPositionProperty($this->liveInfoProperties);
}
/**
* Set the live info position
*
* @api
* @param float $positionX X position
* @param float $positionY Y position
* @param float $positionZ (optional) Z position (Z-index)
* @return static
*/
public function setLiveInfoPosition($positionX, $positionY, $positionZ = null)
{
$this->setPositionProperty($this->liveInfoProperties, $positionX, $positionY, $positionZ);
return $this;
}
/**
* Get the spectator info visibility
*
* @api
* @return bool
*/
public function getSpectatorInfoVisible()
{
return $this->getVisibleProperty($this->spectatorInfoProperties);
}
/**
* Set the spectator info visibility
*
* @api
* @param bool $visible If the spectator info should be visible
* @return static
*/
public function setSpectatorInfoVisible($visible)
{
$this->setVisibleProperty($this->spectatorInfoProperties, $visible);
return $this;
}
/**
* Get the spectator info position
*
* @api
* @return string
*/
public function getSpectatorInfoPosition()
{
return $this->getPositionProperty($this->spectatorInfoProperties);
}
/**
* Set the spectator info position
*
* @api
* @param float $positionX X position
* @param float $positionY Y position
* @param float $positionZ (optional) Z position (Z-index)
* @return static
*/
public function setSpectatorInfoPosition($positionX, $positionY, $positionZ = null)
{
$this->setPositionProperty($this->spectatorInfoProperties, $positionX, $positionY, $positionZ);
return $this;
}
/**
* Get the opponents info visibility
*
* @api
* @return bool
*/
public function getOpponentsInfoVisible()
{
return $this->getVisibleProperty($this->opponentsInfoProperties);
}
/**
* Set the opponents info visibility
*
* @api
* @param bool $visible If the opponents info should be visible
* @return static
*/
public function setOpponentsInfoVisible($visible)
{
$this->setVisibleProperty($this->opponentsInfoProperties, $visible);
return $this;
}
/**
* Get the checkpoint list visibility
*
* @api
* @return bool
*/
public function getCheckpointListVisible()
{
return $this->getVisibleProperty($this->checkpointListProperties);
}
/**
* Set the checkpoint list visibility
*
* @api
* @param bool $visible If the checkpoint list should be visible
* @return static
*/
public function setCheckpointListVisible($visible)
{
$this->setVisibleProperty($this->checkpointListProperties, $visible);
return $this;
}
/**
* Get the checkpoint list position
*
* @api
* @return string
*/
public function getCheckpointListPosition()
{
return $this->getPositionProperty($this->checkpointListProperties);
}
/**
* Set the checkpoint list position
*
* @api
* @param float $positionX X position
* @param float $positionY Y position
* @param float $positionZ (optional) Z position (Z-index)
* @return static
*/
public function setCheckpointListPosition($positionX, $positionY, $positionZ = null)
{
$this->setPositionProperty($this->checkpointListProperties, $positionX, $positionY, $positionZ);
return $this;
}
/**
* Get the round scores visibility
*
* @api
* @return bool
*/
public function getRoundScoresVisible()
{
return $this->getVisibleProperty($this->roundScoresProperties);
}
/**
* Set the round scores visibility
*
* @api
* @param bool $visible If the round scores should be visible
* @return static
*/
public function setRoundScoresVisible($visible)
{
$this->setVisibleProperty($this->roundScoresProperties, $visible);
return $this;
}
/**
* Get the round scores position
*
* @api
* @return string
*/
public function getRoundScoresPosition()
{
return $this->getPositionProperty($this->roundScoresProperties);
}
/**
* Set the round scores position
*
* @api
* @param float $positionX X position
* @param float $positionY Y position
* @param float $positionZ (optional) Z position (Z-index)
* @return static
*/
public function setRoundScoresPosition($positionX, $positionY, $positionZ = null)
{
$this->setPositionProperty($this->roundScoresProperties, $positionX, $positionY, $positionZ);
return $this;
}
/**
* Get the chrono visibility
*
* @api
* @return bool
*/
public function getChronoVisible()
{
return $this->getVisibleProperty($this->chronoProperties);
}
/**
* Set the chrono visibility
*
* @api
* @param bool $visible If the chrono should be visible
* @return static
*/
public function setChronoVisible($visible)
{
$this->setVisibleProperty($this->chronoProperties, $visible);
return $this;
}
/**
* Get the chrono position
*
* @api
* @return string
*/
public function getChronoPosition()
{
return $this->getPositionProperty($this->chronoProperties);
}
/**
* Set the chrono position
*
* @api
* @param float $positionX X position
* @param float $positionY Y position
* @param float $positionZ (optional) Z position (Z-index)
* @return static
*/
public function setChronoPosition($positionX, $positionY, $positionZ = null)
{
$this->setPositionProperty($this->chronoProperties, $positionX, $positionY, $positionZ);
return $this;
}
/**
* Get the speed and distance visibility
*
* @api
* @return bool
*/
public function getSpeedAndDistanceVisible()
{
return $this->getVisibleProperty($this->speedAndDistanceProperties);
}
/**
* Set the speed and distance visibility
*
* @api
* @param bool $visible If the speed and distance should be visible
* @return static
*/
public function setSpeedAndDistanceVisible($visible)
{
$this->setVisibleProperty($this->speedAndDistanceProperties, $visible);
return $this;
}
/**
* Get the speed and distance position
*
* @api
* @return string
*/
public function getSpeedAndDistancePosition()
{
return $this->getPositionProperty($this->speedAndDistanceProperties);
}
/**
* Set the speed and distance position
*
* @api
* @param float $positionX X position
* @param float $positionY Y position
* @param float $positionZ (optional) Z position (Z-index)
* @return static
*/
public function setSpeedAndDistancePosition($positionX, $positionY, $positionZ = null)
{
$this->setPositionProperty($this->speedAndDistanceProperties, $positionX, $positionY, $positionZ);
return $this;
}
/**
* Get the personal best and rank visibility
*
* @api
* @return bool
*/
public function getPersonalBestAndRankVisible()
{
return $this->getVisibleProperty($this->personalBestAndRankProperties);
}
/**
* Set the personal best and rank visibility
*
* @api
* @param bool $visible If the personal best and rank should be visible
* @return static
*/
public function setPersonalBestAndRankVisible($visible)
{
$this->setVisibleProperty($this->personalBestAndRankProperties, $visible);
return $this;
}
/**
* Get the personal best and rank position
*
* @api
* @return string
*/
public function getPersonalBestAndRankPosition()
{
return $this->getPositionProperty($this->personalBestAndRankProperties);
}
/**
* Set the personal best and rank position
*
* @api
* @param float $positionX X position
* @param float $positionY Y position
* @param float $positionZ (optional) Z position (Z-index)
* @return static
*/
public function setPersonalBestAndRankPosition($positionX, $positionY, $positionZ = null)
{
$this->setPositionProperty($this->personalBestAndRankProperties, $positionX, $positionY, $positionZ);
return $this;
}
/**
* Get the position visibility
*
* @api
* @return bool
*/
public function getPositionVisible()
{
return $this->getVisibleProperty($this->positionProperties);
}
/**
* Set the position visibility
*
* @api
* @param bool $visible If the position should be visible
* @return static
*/
public function setPositionVisible($visible)
{
$this->setVisibleProperty($this->positionProperties, $visible);
return $this;
}
/**
* Get the position position
*
* @api
* @return string
*/
public function getPositionPosition()
{
return $this->getPositionProperty($this->positionProperties);
}
/**
* Set the position position
*
* @api
* @param float $positionX X position
* @param float $positionY Y position
* @param float $positionZ (optional) Z position (Z-index)
* @return static
*/
public function setPositionPosition($positionX, $positionY, $positionZ = null)
{
$this->setPositionProperty($this->positionProperties, $positionX, $positionY, $positionZ);
return $this;
}
/**
* Get the checkpoint time visibility
*
* @api
* @return bool
*/
public function getCheckpointTimeVisible()
{
return $this->getVisibleProperty($this->checkpointTimeProperties);
}
/**
* Set the checkpoint time visibility
*
* @api
* @param bool $visible If the checkpoint time should be visible
* @return static
*/
public function setCheckpointTimeVisible($visible)
{
$this->setVisibleProperty($this->checkpointTimeProperties, $visible);
return $this;
}
/**
* Get the checkpoint time position
*
* @api
* @return string
*/
public function getCheckpointTimePosition()
{
return $this->getPositionProperty($this->checkpointTimeProperties);
}
/**
* Set the checkpoint time position
*
* @api
* @param float $positionX X position
* @param float $positionY Y position
* @param float $positionZ (optional) Z position (Z-index)
* @return static
*/
public function setCheckpointTimePosition($positionX, $positionY, $positionZ = null)
{
$this->setPositionProperty($this->checkpointTimeProperties, $positionX, $positionY, $positionZ);
return $this;
}
/**
* Get the warm-up visibility
*
* @api
* @return bool
*/
public function getWarmUpVisible()
{
return $this->getVisibleProperty($this->warmUpProperties);
}
/**
* Set the warm-up visibility
*
* @api
* @param bool $visible If the warm-up should be visible
* @return static
*/
public function setWarmUpVisible($visible)
{
$this->setVisibleProperty($this->warmUpProperties, $visible);
return $this;
}
/**
* Get the warm-up position
*
* @api
* @return string
*/
public function getWarmUpPosition()
{
return $this->getPositionProperty($this->warmUpProperties);
}
/**
* Set the warm-up position
*
* @api
* @param float $positionX X position
* @param float $positionY Y position
* @param float $positionZ (optional) Z position (Z-index)
* @return static
*/
public function setWarmUpPosition($positionX, $positionY, $positionZ = null)
{
$this->setPositionProperty($this->warmUpProperties, $positionX, $positionY, $positionZ);
return $this;
}
/**
* Get the multi-lap info visibility
*
* @api
* @return bool
*/
public function getMultiLapInfoVisible()
{
return $this->getVisibleProperty($this->multiLapInfoProperties);
}
/**
* Set the multi-lap info visibility
*
* @api
* @param bool $visible If the multi-lap info should be visible
* @return static
*/
public function setMultiLapInfoVisible($visible)
{
$this->setVisibleProperty($this->multiLapInfoProperties, $visible);
return $this;
}
/**
* Get the multi-lap info position
*
* @api
* @return string
*/
public function getMultiLapInfoPosition()
{
return $this->getPositionProperty($this->multiLapInfoProperties);
}
/**
* Set the multi-lap info position
*
* @api
* @param float $positionX X position
* @param float $positionY Y position
* @param float $positionZ (optional) Z position (Z-index)
* @return static
*/
public function setMultiLapInfoPosition($positionX, $positionY, $positionZ = null)
{
$this->setPositionProperty($this->multiLapInfoProperties, $positionX, $positionY, $positionZ);
return $this;
}
/**
* Get the checkpoint ranking visibility
*
* @api
* @return bool
*/
public function getCheckpointRankingVisible()
{
return $this->getVisibleProperty($this->checkpointRankingProperties);
}
/**
* Set the checkpoint ranking visibility
*
* @api
* @param bool $visible If the checkpoint ranking should be visible
* @return static
*/
public function setCheckpointRankingVisible($visible)
{
$this->setVisibleProperty($this->checkpointRankingProperties, $visible);
return $this;
}
/**
* Get the checkpoint ranking position
*
* @api
* @return string
*/
public function getCheckpointRankingPosition()
{
return $this->getPositionProperty($this->checkpointRankingProperties);
}
/**
* Set the checkpoint ranking position
*
* @api
* @param float $positionX X position
* @param float $positionY Y position
* @param float $positionZ (optional) Z position (Z-index)
* @return static
*/
public function setCheckpointRankingPosition($positionX, $positionY, $positionZ = null)
{
$this->setPositionProperty($this->checkpointRankingProperties, $positionX, $positionY, $positionZ);
return $this;
}
/**
* @see UIProperties::getProperties()
*/
protected function getProperties()
{
return array_merge(parent::getProperties(), array(
"live_info" => $this->liveInfoProperties,
"spectator_info" => $this->spectatorInfoProperties,
"opponents_info" => $this->opponentsInfoProperties,
"checkpoint_list" => $this->checkpointListProperties,
"round_scores" => $this->roundScoresProperties,
"chrono" => $this->chronoProperties,
"speed_and_distance" => $this->speedAndDistanceProperties,
"personal_best_and_rank" => $this->personalBestAndRankProperties,
"position" => $this->positionProperties,
"checkpoint_time" => $this->checkpointTimeProperties,
"warmup" => $this->warmUpProperties,
"multilap_info" => $this->multiLapInfoProperties,
"checkpoint_ranking" => $this->checkpointRankingProperties
));
}
}

View File

@ -0,0 +1,471 @@
<?php
namespace FML\XmlRpc;
/**
* Class representing common UI Properties
*
* @author steeffeen
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
class UIProperties
{
/**
* @var array $chatProperties Chat properties
*/
protected $chatProperties = array();
/**
* @var array $chatAvatarProperties Chat avatar properties
*/
protected $chatAvatarProperties = array();
/**
* @var array $mapInfoProperties Map info properties
*/
protected $mapInfoProperties = array();
/**
* @var array $countdownProperties Countdown properties
*/
protected $countdownProperties = array();
/**
* @var array $goProperties Go! properties
*/
protected $goProperties = array();
/**
* @var array $endMapLadderRecapProperties End map ladder recap properties
*/
protected $endMapLadderRecapProperties = array();
/**
* @var array $scoresTableProperties Scores table properties
*/
protected $scoresTableProperties = array();
/**
* Create new UI Properties
*
* @api
* @return static
*/
public static function create()
{
return new static();
}
/**
* Get the chat visibility
*
* @api
* @return bool
*/
public function getChatVisible()
{
return $this->getVisibleProperty($this->chatProperties);
}
/**
* Set the chat visibility
*
* @api
* @param bool $visible If the chat should be visible
* @return static
*/
public function setChatVisible($visible)
{
$this->setVisibleProperty($this->chatProperties, $visible);
return $this;
}
/**
* Get the chat offset
*
* @api
* @return string
*/
public function getChatOffset()
{
return $this->getProperty($this->chatProperties, "offset");
}
/**
* Set the chat offset
*
* @api
* @param float $offsetX X offset
* @param float $offsetY Y offset
* @return static
*/
public function setChatOffset($offsetX, $offsetY)
{
$offset = array((float)$offsetX, (float)$offsetY);
$this->setProperty($this->chatProperties, "offset", implode(" ", $offset));
return $this;
}
/**
* Get the chat line count
*
* @api
* @return int
*/
public function getChatLineCount()
{
return $this->getProperty($this->chatProperties, "linecount");
}
/**
* Set the chat line count
*
* @api
* @param int $lineCount Line count
* @return static
*/
public function setChatLineCount($lineCount)
{
$this->setProperty($this->chatProperties, "linecount", (int)$lineCount);
return $this;
}
/**
* Get the chat avatar visibility
*
* @api
* @return bool
*/
public function getChatAvatarVisible()
{
return $this->getVisibleProperty($this->chatAvatarProperties);
}
/**
* Set the chat avatar visibility
*
* @api
* @param bool $visible If the chat avatar should be visible
* @return static
*/
public function setChatAvatarVisible($visible)
{
$this->setVisibleProperty($this->chatAvatarProperties, $visible);
return $this;
}
/**
* Get the map info visibility
*
* @api
* @return bool
*/
public function getMapInfoVisible()
{
return $this->getVisibleProperty($this->mapInfoProperties);
}
/**
* Set the map info visibility
*
* @api
* @param bool $visible If the map info should be visible
* @return static
*/
public function setMapInfoVisible($visible)
{
$this->setVisibleProperty($this->mapInfoProperties, $visible);
return $this;
}
/**
* Get the map info position
*
* @api
* @return string
*/
public function getMapInfoPosition()
{
return $this->getPositionProperty($this->mapInfoProperties);
}
/**
* Set the map info position
*
* @api
* @param float $positionX X position
* @param float $positionY Y position
* @param float $positionZ (optional) Z position (Z-index)
* @return static
*/
public function setMapInfoPosition($positionX, $positionY, $positionZ = null)
{
$this->setPositionProperty($this->mapInfoProperties, $positionX, $positionY, $positionZ);
return $this;
}
/**
* Get the countdown visibility
*
* @api
* @return bool
*/
public function getCountdownVisible()
{
return $this->getVisibleProperty($this->countdownProperties);
}
/**
* Set the countdown visibility
*
* @api
* @param bool $visible If the countdown should be visible
* @return static
*/
public function setCountdownVisible($visible)
{
$this->setVisibleProperty($this->countdownProperties, $visible);
return $this;
}
/**
* Get the countdown position
*
* @api
* @return string
*/
public function getCountdownPosition()
{
return $this->getPositionProperty($this->countdownProperties);
}
/**
* Set the countdown position
*
* @api
* @param float $positionX X position
* @param float $positionY Y position
* @param float $positionZ (optional) Z position (Z-index)
* @return static
*/
public function setCountdownPosition($positionX, $positionY, $positionZ = null)
{
$this->setPositionProperty($this->countdownProperties, $positionX, $positionY, $positionZ);
return $this;
}
/**
* Get the Go! visibility
*
* @api
* @return bool
*/
public function getGoVisible()
{
return $this->getVisibleProperty($this->goProperties);
}
/**
* Set the Go! visibility
*
* @api
* @param bool $visible If Go! should be visible
* @return static
*/
public function setGoVisible($visible)
{
$this->setVisibleProperty($this->goProperties, $visible);
return $this;
}
/**
* Get the end map ladder recap visibility
*
* @api
* @return bool
*/
public function getEndMapLadderRecapVisible()
{
return $this->getVisibleProperty($this->endMapLadderRecapProperties);
}
/**
* Set the end map ladder recap visibility
*
* @api
* @param bool $visible If the end map ladder recap should be visible
* @return static
*/
public function setEndMapLadderRecapVisible($visible)
{
$this->setVisibleProperty($this->endMapLadderRecapProperties, $visible);
return $this;
}
/**
* Get the scores table alt visibility
*
* @api
* @return bool
*/
public function getScoresTableAltVisible()
{
return $this->getProperty($this->scoresTableProperties, "alt_visible");
}
/**
* Set the scores table alt visibility
*
* @api
* @param bool $altVisible If the scores table should be visible on alt
* @return static
*/
public function setScoresTableAltVisible($altVisible)
{
$this->setProperty($this->scoresTableProperties, "alt_visible", (bool)$altVisible);
return $this;
}
/**
* Render the UI Properties standalone
*
* @return \DOMDocument
*/
public function renderStandalone()
{
$domDocument = new \DOMDocument("1.0", "utf-8");
$domDocument->xmlStandalone = true;
$domElement = $domDocument->createElement("ui_properties");
$domDocument->appendChild($domElement);
$allProperties = $this->getProperties();
foreach ($allProperties as $property => $propertySettings) {
if (!$propertySettings) {
continue;
}
$propertyDomElement = $domDocument->createElement($property);
$domElement->appendChild($propertyDomElement);
foreach ($propertySettings as $settingName => $settingValue) {
$settingValueString = (is_string($settingValue) ? $settingValue : var_export($settingValue, true));
$propertyDomElement->setAttribute($settingName, $settingValueString);
}
}
return $domDocument;
}
/**
* Get string representation
*
* @return string
*/
public function __toString()
{
return $this->renderStandalone()
->saveXML();
}
/**
* Get associative array of all properties
*
* @return array
*/
protected function getProperties()
{
return array(
"chat" => $this->chatProperties,
"chat_avatar" => $this->chatAvatarProperties,
"map_info" => $this->mapInfoProperties,
"countdown" => $this->countdownProperties,
"go" => $this->goProperties,
"endmap_ladder_recap" => $this->endMapLadderRecapProperties,
"scorestable" => $this->scoresTableProperties
);
}
/**
* Get a property value if it's set
*
* @param array $properties Properties array
* @param string $name Property name
* @return mixed
*/
protected function getProperty(array $properties, $name)
{
return (isset($properties[$name]) ? $properties[$name] : null);
}
/**
* Set a property value
*
* @param array $properties Properties array
* @param string $name Property name
* @param mixed $value Property value
* @return static
*/
protected function setProperty(array &$properties, $name, $value)
{
$properties[$name] = $value;
return $this;
}
/**
* Set the Visible property value
*
* @param array $properties Properties array
* @return bool
*/
protected function getVisibleProperty(array &$properties)
{
return $this->getProperty($properties, "visible");
}
/**
* Set the Visible property value
*
* @param array $properties Properties array
* @param bool $visible Visibility value
* @return static
*/
protected function setVisibleProperty(array &$properties, $visible)
{
$this->setProperty($properties, "visible", (bool)$visible);
return $this;
}
/**
* Get the Position property value
*
* @param array $properties Properties array
* @return string
*/
protected function getPositionProperty(array &$properties)
{
return $this->getProperty($properties, "pos");
}
/**
* Set the Position property value
*
* @param array $properties Properties array
* @param float $positionX X position
* @param float $positionY Y position
* @param float $positionZ (optional) Z position (Z-index)
* @return static
*/
protected function setPositionProperty(array &$properties, $positionX, $positionY, $positionZ = null)
{
$position = array((float)$positionX, (float)$positionY);
if ($positionZ) {
array_push($position, (float)$positionZ);
}
$this->setProperty($properties, "pos", implode(" ", $position));
return $this;
}
}