moved Utility classes into own folder+namespace

This commit is contained in:
Steffen Schröder 2014-05-13 14:32:30 +02:00
parent 2fd501f2e8
commit 00eb49414a
30 changed files with 39 additions and 37 deletions

View File

@ -16,7 +16,7 @@ use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\ManiaControl;
use ManiaControl\Players\Player;
use ManiaControl\Players\PlayerManager;
use ManiaControl\Settings\SettingManager;
use ManiaControl\Settings\Setting;
/**
* Class offering a Configurator for ManiaControl Settings
@ -173,7 +173,7 @@ class ManiaControlSettings implements ConfiguratorMenu, CallbackListener {
$nameLabel->setText($setting->setting);
$nameLabel->setTextColor("FFF");
if ($setting->type === SettingManager::TYPE_BOOL) {
if ($setting->type === Setting::TYPE_BOOL) {
$quad = new Quad_Icons64x64_1();
$settingFrame->add($quad);
$quad->setX($width / 2 * 0.6);

View File

@ -2,7 +2,7 @@
namespace ManiaControl\Files;
use ManiaControl\Formatter;
use ManiaControl\Utils\Formatter;
use ManiaControl\ManiaControl;
/**

View File

@ -23,6 +23,8 @@ use ManiaControl\Server\Server;
use ManiaControl\Settings\SettingManager;
use ManiaControl\Statistics\StatisticManager;
use ManiaControl\Update\UpdateManager;
use ManiaControl\Utils\CommandLineHelper;
use ManiaControl\Utils\Formatter;
use Maniaplanet\DedicatedServer\Connection;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
use Maniaplanet\DedicatedServer\Xmlrpc\TransportException;

View File

@ -2,7 +2,7 @@
namespace ManiaControl\ManiaExchange;
use ManiaControl\Formatter;
use ManiaControl\Utils\Formatter;
/**
* Mania Exchange Map Info Object

View File

@ -16,8 +16,8 @@ use FML\ManiaLink;
use FML\Script\Features\Paging;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\ColorUtil;
use ManiaControl\Formatter;
use ManiaControl\Utils\ColorUtil;
use ManiaControl\Utils\Formatter;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\IconManager;
use ManiaControl\Manialinks\ManialinkManager;

View File

@ -2,7 +2,7 @@
namespace ManiaControl\Maps;
use ManiaControl\Formatter;
use ManiaControl\Utils\Formatter;
use ManiaControl\ManiaExchange\MXMapInfo;
/**
@ -53,7 +53,7 @@ class Map {
if (!$mpMap) {
return;
}
$this->name = FORMATTER::stripDirtyCodes($mpMap->name);
$this->name = Formatter::stripDirtyCodes($mpMap->name);
$this->rawName = $mpMap->name;
$this->uid = $mpMap->uId;
$this->fileName = $mpMap->fileName;

View File

@ -17,8 +17,8 @@ use FML\Script\Features\Paging;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Callbacks\Callbacks;
use ManiaControl\ColorUtil;
use ManiaControl\Formatter;
use ManiaControl\Utils\ColorUtil;
use ManiaControl\Utils\Formatter;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\IconManager;
use ManiaControl\Manialinks\ManialinkManager;

View File

@ -7,7 +7,7 @@ use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Callbacks\Callbacks;
use ManiaControl\Commands\CommandListener;
use ManiaControl\Formatter;
use ManiaControl\Utils\Formatter;
use ManiaControl\ManiaControl;
use ManiaControl\Players\Player;
use Maniaplanet\DedicatedServer\Xmlrpc\NextMapException;

View File

@ -2,7 +2,7 @@
namespace ManiaControl\Players;
use ManiaControl\Formatter;
use ManiaControl\Utils\Formatter;
use ManiaControl\ManiaControl;
/**

View File

@ -8,7 +8,7 @@ use FML\Controls\Quad;
use FML\Controls\Quads\Quad_Icons64x64_1;
use FML\ManiaLink;
use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Formatter;
use ManiaControl\Utils\Formatter;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkManager;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;

View File

@ -10,7 +10,7 @@ use FML\Controls\Quad;
use FML\Controls\Quads\Quad_BgsPlayerCard;
use FML\ManiaLink;
use FML\Script\Script;
use ManiaControl\Formatter;
use ManiaControl\Utils\Formatter;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkManager;
use ManiaControl\Statistics\StatisticManager;

View File

@ -18,7 +18,7 @@ use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Callbacks\TimerListener;
use ManiaControl\Formatter;
use ManiaControl\Utils\Formatter;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkManager;
use ManiaControl\Manialinks\ManialinkPageAnswerListener;

View File

@ -6,7 +6,7 @@ use ManiaControl\Admin\AdminLists;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Callbacks\TimerListener;
use ManiaControl\Formatter;
use ManiaControl\Utils\Formatter;
use ManiaControl\ManiaControl;
use ManiaControl\Statistics\StatisticManager;
use Maniaplanet\DedicatedServer\Xmlrpc\LoginUnknownException;

View File

@ -20,7 +20,7 @@ use ManiaControl\Configurators\ConfiguratorMenu;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkPageAnswerListener;
use ManiaControl\Players\Player;
use ManiaControl\Settings\SettingManager;
use ManiaControl\Settings\Setting;
/**
* Configurator for enabling and disabling Plugins
@ -254,7 +254,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
$y = 0;
$index = 0;
$settingHeight = 5.;
$pageFrame = null;
$pageFrame = null;
foreach ($settings as $setting) {
if ($index % $pageSettingsMaxCount === 0) {
@ -311,7 +311,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
$entry->setDefault($setting->value);
if ($setting->type === SettingManager::TYPE_BOOL) {
if ($setting->type === Setting::TYPE_BOOL) {
if ($setting->value == "0") {
$substyle = Quad_Icons64x64_1::SUBSTYLE_LvlRed;
} else if ($setting->value == "1") {
@ -389,7 +389,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
}
} else if ($settings) {
// Open Settings Menu
$pluginClass = substr($actionId, strlen(self::ACTION_PREFIX_SETTINGS));
$pluginClass = substr($actionId, strlen(self::ACTION_PREFIX_SETTINGS));
$player->setCache($this, self::CACHE_SETTING_CLASS, $pluginClass);
} else if ($boolSetting) {
$actionArray = explode(".", $actionId);

View File

@ -4,7 +4,7 @@ namespace ManiaControl\Server;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\CommandLineHelper;
use ManiaControl\Utils\CommandLineHelper;
use ManiaControl\ManiaControl;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;

View File

@ -3,7 +3,7 @@
namespace ManiaControl\Server;
use ManiaControl\Callbacks\TimerListener;
use ManiaControl\Formatter;
use ManiaControl\Utils\Formatter;
use ManiaControl\ManiaControl;
use ManiaControl\Plugins\Plugin;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;

View File

@ -2,7 +2,7 @@
namespace ManiaControl\Settings;
use ManiaControl\ClassUtil;
use ManiaControl\Utils\ClassUtil;
/**
* Model Class for a Setting

View File

@ -4,9 +4,9 @@ namespace ManiaControl\Settings;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\ClassUtil;
use ManiaControl\ManiaControl;
use ManiaControl\Plugins\PluginManager;
use ManiaControl\Utils\ClassUtil;
/**
* Class managing Settings and Configurations
@ -132,7 +132,7 @@ class SettingManager implements CallbackListener {
* @return Setting
*/
public function setSetting($object, $settingName, $value) {
$className = $this->getClassName($object);
$className = ClassUtil::getClass($object);
$setting = $this->getSetting($object, $settingName);
if ($setting) {

View File

@ -14,7 +14,7 @@ use FML\ManiaLink;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Commands\CommandListener;
use ManiaControl\Formatter;
use ManiaControl\Utils\Formatter;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkManager;
use ManiaControl\Manialinks\ManialinkPageAnswerListener;

View File

@ -1,6 +1,6 @@
<?php
namespace ManiaControl;
namespace ManiaControl\Utils;
/**
* Utility Class offering Methods related to Classes

View File

@ -1,6 +1,6 @@
<?php
namespace ManiaControl;
namespace ManiaControl\Utils;
/**
* Utility Class offering Methods to convert and use ManiaPlanet Colors

View File

@ -1,6 +1,6 @@
<?php
namespace ManiaControl;
namespace ManiaControl\Utils;
/**
* Command Line Helper Class

View File

@ -1,6 +1,6 @@
<?php
namespace ManiaControl;
namespace ManiaControl\Utils;
/**
* Class offering Methods to format Texts and Values

View File

@ -18,7 +18,7 @@ use FML\Script\Features\KeyAction;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Callbacks\TimerListener;
use ManiaControl\ColorUtil;
use ManiaControl\Utils\ColorUtil;
use ManiaControl\Commands\CommandListener;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkPageAnswerListener;

View File

@ -14,7 +14,7 @@ use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Callbacks\Callbacks;
use ManiaControl\Callbacks\TimerListener;
use ManiaControl\Commands\CommandListener;
use ManiaControl\Formatter;
use ManiaControl\Utils\Formatter;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkManager;
use ManiaControl\Players\Player;

View File

@ -2,7 +2,7 @@
namespace MCTeam\Dedimania;
use ManiaControl\Formatter;
use ManiaControl\Utils\Formatter;
/**
* ManiaControl Dedimania-Plugin Record DataStructure

View File

@ -11,7 +11,7 @@ use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Callbacks\Callbacks;
use ManiaControl\Callbacks\TimerListener;
use ManiaControl\ColorUtil;
use ManiaControl\Utils\ColorUtil;
use ManiaControl\ManiaControl;
use ManiaControl\Maps\Map;
use ManiaControl\Players\Player;

View File

@ -15,7 +15,7 @@ use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Callbacks\Callbacks;
use ManiaControl\Callbacks\TimerListener;
use ManiaControl\Commands\CommandListener;
use ManiaControl\Formatter;
use ManiaControl\Utils\Formatter;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkManager;
use ManiaControl\Maps\Map;

View File

@ -13,7 +13,7 @@ use FML\Script\Script;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\Callbacks;
use ManiaControl\Callbacks\TimerListener;
use ManiaControl\Formatter;
use ManiaControl\Utils\Formatter;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\IconManager;
use ManiaControl\Maps\Map;

View File

@ -11,7 +11,7 @@ use FML\ManiaLink;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\TimerListener;
use ManiaControl\Commands\CommandListener;
use ManiaControl\Formatter;
use ManiaControl\Utils\Formatter;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkManager;
use ManiaControl\Manialinks\ManialinkPageAnswerListener;