TrackManiaControl/core/Callbacks/Structures/Common/StatusCallbackStructure.php

55 lines
1.2 KiB
PHP
Raw Normal View History

<?php
2017-04-08 13:45:04 +02:00
namespace ManiaControl\Callbacks\Structures\Common;
use ManiaControl\ManiaControl;
/**
* Structure Class for the StatusCallback Structure Callback
*
2017-04-07 23:26:35 +02:00
* @api
* @author ManiaControl Team <mail@maniacontrol.com>
2018-03-27 20:11:40 +02:00
* @copyright 2014-2018 ManiaControl Team
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
class StatusCallbackStructure extends BaseResponseStructure {
protected $active;
protected $available;
/**
* Construct a new On Hit Structure
*
* @param ManiaControl $maniaControl
* @param array $data
*/
public function __construct(ManiaControl $maniaControl, $data) {
parent::__construct($maniaControl, $data);
$this->active = $this->getPlainJsonObject()->active;
2018-07-11 17:47:17 +02:00
if(property_exists($this->getPlainJsonObject(), "available")){
$this->available = $this->getPlainJsonObject()->available;
}
}
/**
* True if the Status (Like Combo Pause or Warmup) is Ongoing
*
2017-04-07 23:26:35 +02:00
* @api
* @return boolean
*/
public function getActive() {
return $this->active;
}
/**
* Checks if the Mode uses Warmup or not
*
* @api
* @return boolean
*/
public function isAvailable() {
return $this->available;
}
}