2014-05-03 21:57:38 +02:00
|
|
|
<?php
|
2014-05-03 23:49:58 +02:00
|
|
|
|
2014-05-03 21:57:38 +02:00
|
|
|
namespace Dedimania;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ManiaControl Dedimania-Plugin Player DataStructure
|
|
|
|
*
|
2014-05-03 23:49:58 +02:00
|
|
|
* @author ManiaControl Team <mail@maniacontrol.com>
|
|
|
|
* @copyright 2014 ManiaControl Team
|
|
|
|
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
2014-05-03 21:57:38 +02:00
|
|
|
*/
|
|
|
|
class DedimaniaPlayer {
|
2014-05-03 23:49:58 +02:00
|
|
|
/*
|
|
|
|
* Public Properties
|
|
|
|
*/
|
2014-05-03 21:57:38 +02:00
|
|
|
public $login = '';
|
|
|
|
public $maxRank = -1;
|
|
|
|
public $banned = false;
|
|
|
|
public $optionsEnabled = false;
|
|
|
|
public $options = '';
|
|
|
|
|
2014-05-03 23:49:58 +02:00
|
|
|
/**
|
|
|
|
* Construct a new Dedimania Player Model
|
|
|
|
* @param mixed$player
|
|
|
|
*/
|
2014-05-03 21:57:38 +02:00
|
|
|
public function __construct($player) {
|
2014-05-03 23:49:58 +02:00
|
|
|
if (!$player) {
|
|
|
|
return;
|
|
|
|
}
|
2014-05-03 21:57:38 +02:00
|
|
|
|
|
|
|
$this->login = $player['Login'];
|
|
|
|
$this->maxRank = $player['MaxRank'];
|
|
|
|
$this->banned = $player['Banned'];
|
|
|
|
$this->optionsEnabled = $player['OptionsEnabled'];
|
|
|
|
$this->options = $player['Options'];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Construct a new Player by its login and maxRank
|
|
|
|
*
|
2014-05-03 23:49:58 +02:00
|
|
|
* @param string $login
|
|
|
|
* @param int $maxRank
|
2014-05-03 21:57:38 +02:00
|
|
|
*/
|
|
|
|
public function constructNewPlayer($login, $maxRank) {
|
|
|
|
$this->login = $login;
|
|
|
|
$this->maxRank = $maxRank;
|
|
|
|
}
|
|
|
|
}
|