Changed Plugin Class to Interface! (Final)

-> static methods for Name, Version, Author, Description
This commit is contained in:
Steffen Schröder
2013-12-03 22:21:17 +01:00
parent 35a7232894
commit 6c247f0519
8 changed files with 247 additions and 63 deletions

View File

@ -9,11 +9,11 @@ use ManiaControl\Plugins\Plugin;
*
* @author steeffeen
*/
class EndurancePlugin extends Plugin implements CallbackListener {
class EndurancePlugin implements CallbackListener, Plugin {
/**
* Constants
*/
const VERSION = '1.0';
const VERSION = 1.0;
const CB_CHECKPOINT = 'Endurance.Checkpoint';
/**
@ -30,18 +30,44 @@ class EndurancePlugin extends Plugin implements CallbackListener {
public function __construct(ManiaControl $maniaControl) {
$this->maniaControl = $maniaControl;
// Plugin information
self::$name = 'Endurance Plugin';
self::$version = self::VERSION;
self::$author = 'steeffeen';
self::$description = "Plugin enabling Support for the TM Game Mode 'Endurance' by TGYoshi.";
// Register for callbacks
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_ONINIT, $this, 'callback_OnInit');
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_BEGINMAP, $this, 'callback_BeginMap');
$this->maniaControl->callbackManager->registerScriptCallbackListener(self::CB_CHECKPOINT, $this, 'callback_Checkpoint');
}
/**
*
* @see \ManiaControl\Plugins\Plugin::getName()
*/
public static function getName() {
return 'Endurance Plugin';
}
/**
*
* @see \ManiaControl\Plugins\Plugin::getVersion()
*/
public static function getVersion() {
return self::VERSION;
}
/**
*
* @see \ManiaControl\Plugins\Plugin::getAuthor()
*/
public static function getAuthor() {
return 'steeffeen';
}
/**
*
* @see \ManiaControl\Plugins\Plugin::getDescription()
*/
public static function getDescription() {
return "Plugin enabling Support for the TM Game Mode 'Endurance' by TGYoshi.";
}
/**
* Handle ManiaControl OnInit callback
*