big refactor dedimania plugin

This commit is contained in:
kremsy
2017-05-19 23:53:21 +02:00
parent ff3c492bbf
commit a6831be5be
3 changed files with 740 additions and 648 deletions

View File

@ -67,6 +67,17 @@ class DedimaniaData {
});
}
/**
* Update the Record Ranks
*/
public function updateRanks() {
$rank = 1;
foreach ($this->records as $record) {
$record->rank = $rank;
$rank++;
}
}
/**
* Build the Data Array
*
@ -92,6 +103,31 @@ class DedimaniaData {
return count($this->records);
}
/**
* Checks if a Record is in the array
*
* @return bool
*/
public function recordsExisting() {
return $this->getRecordCount() > 0;
}
/**
* Unsets all existing Records
*/
public function unsetRecords() {
unset($this->records);
}
/**
* Deletes a Record by its Index
*
* @param $index
*/
public function deleteRecordByIndex($index) {
unset($this->records[$index]);
}
/**
* Get Max Rank for a certain Player
*