improved plugin menu

use player cache for selected setting class
This commit is contained in:
Steffen Schröder
2014-05-09 20:11:48 +02:00
parent 6fd7775bcb
commit ba0f417f59
3 changed files with 155 additions and 139 deletions

View File

@ -244,10 +244,40 @@ class Player {
$this->currentTargetId = intval($spectatorStatus / 10000);
}
/**
* Get the Cache with the given Name
*
* @param string $cacheName
* @return mixed
*/
public function getCache($cacheName) {
if (isset($this->cache[$cacheName])) {
return $this->cache[$cacheName];
}
return null;
}
/**
* Set the Cache Data for the given Name
*
* @param string $cacheName
* @param mixed $data
*/
public function setCache($cacheName, $data) {
$this->cache[$cacheName] = data;
}
/**
* Clear the Player's Temporary Data
*/
public function clearCache() {
$this->cache = array();
}
/**
* Var_Dump the Player
*/
public function dump() {
var_dump(json_decode(json_encode($this)));
}
}