created directory browser class

This commit is contained in:
steeffeen 2014-06-29 23:51:01 +02:00
parent 897111feff
commit a948dd57c1
2 changed files with 50 additions and 6 deletions

View File

@ -0,0 +1,42 @@
<?php
namespace ManiaControl\Maps;
use FML\ManiaLink;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkManager;
use ManiaControl\Players\Player;
/**
* Maps Directory Browser
*
* @author ManiaControl Team <mail@maniacontrol.com>
* @copyright 2014 ManiaControl Team
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
class DirectoryBrowser {
/*
* Private properties
*/
private $maniaControl = null;
/**
* Create a new Directory Browser Instance
*
* @param ManiaControl $maniaControl
*/
public function __construct(ManiaControl $maniaControl) {
$this->maniaControl = $maniaControl;
}
/**
* Build and show the Browser ManiaLink to the given Player
*
* @param Player $player
*/
public function showManiaLink(Player $player) {
$maniaLink = new ManiaLink(ManialinkManager::MAIN_MLID);
$this->maniaControl->manialinkManager->sendManialink($maniaLink, $player);
}
}

View File

@ -58,6 +58,7 @@ class MapManager implements CallbackListener {
public $mapQueue = null; public $mapQueue = null;
public $mapCommands = null; public $mapCommands = null;
public $mapList = null; public $mapList = null;
public $directoryBrowser = null;
public $mxList = null; public $mxList = null;
public $mxManager = null; public $mxManager = null;
public $mapActions = null; public $mapActions = null;
@ -82,12 +83,13 @@ class MapManager implements CallbackListener {
$this->initTables(); $this->initTables();
// Create map commands instance // Create map commands instance
$this->mxManager = new ManiaExchangeManager($this->maniaControl); $this->mxManager = new ManiaExchangeManager($this->maniaControl);
$this->mapList = new MapList($this->maniaControl); $this->mapList = new MapList($this->maniaControl);
$this->mxList = new ManiaExchangeList($this->maniaControl); $this->directoryBrowser = new DirectoryBrowser($this->maniaControl);
$this->mapCommands = new MapCommands($maniaControl); $this->mxList = new ManiaExchangeList($this->maniaControl);
$this->mapQueue = new MapQueue($this->maniaControl); $this->mapCommands = new MapCommands($maniaControl);
$this->mapActions = new MapActions($maniaControl); $this->mapQueue = new MapQueue($this->maniaControl);
$this->mapActions = new MapActions($maniaControl);
// Register for callbacks // Register for callbacks
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ONINIT, $this, 'handleOnInit'); $this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ONINIT, $this, 'handleOnInit');