improve dedimania plugin
This commit is contained in:
committed by
Steffen Schröder
parent
6a42a3d6f3
commit
bcd8a9de67
60
application/plugins/Dedimania/RecordData.php
Normal file
60
application/plugins/Dedimania/RecordData.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Lukas
|
||||
* Date: 23.02.14
|
||||
* Time: 11:31
|
||||
*/
|
||||
|
||||
namespace Dedimania;
|
||||
|
||||
|
||||
use ManiaControl\Formatter;
|
||||
|
||||
class RecordData {
|
||||
public $nullRecord = false;
|
||||
public $login = '';
|
||||
public $nickName = '';
|
||||
public $best = -1;
|
||||
public $rank = -1;
|
||||
public $maxRank = -1;
|
||||
public $checkpoints = '';
|
||||
public $newRecord = false;
|
||||
public $vReplay = '';
|
||||
public $top1GReplay = '';
|
||||
|
||||
/**
|
||||
* Construct a Record by a given Record Array
|
||||
* @param $record
|
||||
*/
|
||||
public function __construct($record) {
|
||||
if ($record == null) {
|
||||
$this->nullRecord = true;
|
||||
return;
|
||||
}
|
||||
|
||||
$this->login = $record['Login'];
|
||||
$this->nickName = Formatter::stripDirtyCodes($record['NickName']);
|
||||
$this->best = $record['Best'];
|
||||
$this->rank = $record['Rank'];
|
||||
$this->maxRank = $record['MaxRank'];
|
||||
$this->checkpoints = $record['Checks'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new Record via it's properties
|
||||
* @param $login
|
||||
* @param $nickName
|
||||
* @param $best
|
||||
* @param $checkpoints
|
||||
* @param bool $newRecord
|
||||
*/
|
||||
public function constructNewRecord($login, $nickName, $best, $checkpoints, $newRecord = false) {
|
||||
$this->nullRecord = false;
|
||||
$this->login = $login;
|
||||
$this->nickName = $nickName;
|
||||
$this->best = $best;
|
||||
$this->checkpoints = $checkpoints;
|
||||
$this->newRecord = $newRecord;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user