Refactored Controller

Refactored Database adapters

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
This commit is contained in:
Gregory PLANCHAT 2012-03-01 18:20:05 +01:00
commit 03efb85c0b
76 changed files with 502 additions and 457 deletions

View file

@ -28,7 +28,7 @@
*
*/
$CombatCaps = Wootook_Empire_Model_Game_Combat::getSingleton();
$CombatCaps = Wootook_Empire_Helper_Config_Combat::getSingleton();
$AtFleet = array ( 203 => 2 );
$AtTechn = array ( 109 => 3, 110 => 5, 111 => 3 );

View file

@ -149,7 +149,7 @@ function GetBuildingPrice($currentUser, $currentPlanet, $buildingId, $incrementa
$currentUser = Wootook_Player_Model_Entity::factory($currentUser['id']);
}
$types = Wootook_Empire_Model_Game_Types::getSingleton();
$types = Wootook_Empire_Helper_Config_Types::getSingleton();
if ($types->is($buildingId, Legacies_Empire::TYPE_BUILDING)) {
$level = $currentPlanet->getElement($buildingId);
@ -202,7 +202,7 @@ function GetBuildingTime($currentUser, $currentPlanet, $buildingId)
$currentUser = Wootook_Player_Model_Entity::factory($currentUser['id']);
}
$types = Wootook_Empire_Model_Game_Types::getSingleton();
$types = Wootook_Empire_Helper_Config_Types::getSingleton();
if ($types->is($buildingId, Legacies_Empire::TYPE_BUILDING)) {
return $currentPlanet->getBuildingTime($buildingId, 1);
@ -237,7 +237,7 @@ function GetBuildingTimeLevel($currentUser, $currentPlanet, $buildingId, $level)
$currentUser = Wootook_Player_Model_Entity::factory($currentUser['id']);
}
$types = Wootook_Empire_Model_Game_Types::getSingleton();
$types = Wootook_Empire_Helper_Config_Types::getSingleton();
if ($types->is($buildingId, Legacies_Empire::TYPE_BUILDING)) {
return $currentPlanet->getBuildingTime($buildingId, $level);
@ -274,8 +274,8 @@ function GetElementPrice($currentUser, $currentPlanet, $buildingId, $userfactor
global $lang;
$prices = Wootook_Empire_Model_Game_Prices::getSingleton();
$types = Wootook_Empire_Model_Game_Types::getSingleton();
$prices = Wootook_Empire_Helper_Config_Prices::getSingleton();
$types = Wootook_Empire_Helper_Config_Types::getSingleton();
$array = array(
Legacies_Empire::RESOURCE_METAL => $lang["Metal"],
@ -496,17 +496,17 @@ function CancelBuildingFromQueue($currentPlanet, $currentUser)
class Deprecated
{
/**
* @var Wootook_Core_Layout $layout
* @var Wootook_Core_Model_Layout $layout
*/
public static $layout = null;
/**
* @return Wootook_Core_Layout
* @return Wootook_Core_Model_Layout
*/
public static function getLayout($adminPage = false)
{
if (self::$layout === null) {
self::$layout = new Wootook_Core_Layout();
self::$layout = new Wootook_Core_Model_Layout();
}
return self::$layout;
@ -531,7 +531,7 @@ function display($page, $title = '', $topnav = true, $metatags = '', $adminPage
if ($adminPage === false) {
$layout->load('empire');
} else {
$layout->setDomain(Wootook_Core_Layout::DOMAIN_BACKEND);
$layout->setDomain(Wootook_Core_Model_Layout::DOMAIN_BACKEND);
$layout->load('admin');
}
@ -627,9 +627,9 @@ function doquery($query, $table, $fetch = false)
defined('DEPRECATION') || Wootook_Core_ErrorProfiler::getSingleton()->addException(new Wootook_Core_Exception_Deprecated(sprintf('Function "%s" is deprecated', __FUNCTION__)));
/**
* @var Wootook_Core_Database $database
* @var Wootook_Core_Database_Adapter_Pdo_Mysql $database
*/
$database = Wootook_Core_Database::getSingleton();
$database = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection(Wootook_Core_Database_ConnectionManager::DEFAULT_CONNECTION_NAME);
$sql = str_replace("{{table}}", $database->getTable($table), $query);

View file

@ -36,9 +36,9 @@ function MissionCaseAttack($FleetRow)
{
global $lang;
$pricelist = Wootook_Empire_Model_Game_Prices::getSingleton();
$resource = Wootook_Empire_Model_Game_FieldsAlias::getSingleton();
$CombatCaps = Wootook_Empire_Model_Game_Combat::getSingleton();
$pricelist = Wootook_Empire_Helper_Config_Prices::getSingleton();
$resource = Wootook_Empire_Helper_Config_FieldsAlias::getSingleton();
$CombatCaps = Wootook_Empire_Helper_Config_Combat::getSingleton();
if ($FleetRow['fleet_mess'] == 0 && $FleetRow['fleet_start_time'] <= time()) {

View file

@ -37,7 +37,7 @@ function MissionCaseSpy($FleetRow)
{
global $lang;
$resource = Wootook_Empire_Model_Game_FieldsAlias::getSingleton();
$resource = Wootook_Empire_Helper_Config_FieldsAlias::getSingleton();
if ($FleetRow['fleet_start_time'] <= time()) {
// refactored parts

View file

@ -46,14 +46,14 @@ $messfields = array (
100 => "new_message"
);
$resource = Wootook_Empire_Model_Game_FieldsAlias::getSingleton();
$resource = Wootook_Empire_Helper_Config_FieldsAlias::getSingleton();
$requirements = Wootook_Empire_Model_Game_Requirements::getSingleton();
$requirements = Wootook_Empire_Helper_Config_Requirements::getSingleton();
$pricelist = Wootook_Empire_Model_Game_Prices::getSingleton();
$pricelist = Wootook_Empire_Helper_Config_Prices::getSingleton();
$CombatCaps = Wootook_Empire_Model_Game_Combat::getSingleton();
$CombatCaps = Wootook_Empire_Helper_Config_Combat::getSingleton();
$ProdGrid = Wootook_Empire_Model_Game_Production::getSingleton();
$ProdGrid = Wootook_Empire_Helper_Config_Production::getSingleton();
$reslist = Wootook_Empire_Model_Game_Types::getSingleton();
$reslist = Wootook_Empire_Helper_Config_Types::getSingleton();