From: Roland Haeder Date: Tue, 25 Aug 2015 19:47:07 +0000 (+0200) Subject: They don't need map expansion: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4ba87b04cb4afad75d08cd6a80022f715d04ce4a;p=city.git They don't need map expansion: - Lots don't get expanded by the daemon, the user just sets it and the daemon validates and executes the "expansion". - Also districts don't get expanded for the same reason. Signed-off-by: Roland Haeder --- diff --git a/application/city/classes/manager/city_entities/districts/class_CityDistrictsManager.php b/application/city/classes/manager/city_entities/districts/class_CityDistrictsManager.php index a029214..3e921ee 100644 --- a/application/city/classes/manager/city_entities/districts/class_CityDistrictsManager.php +++ b/application/city/classes/manager/city_entities/districts/class_CityDistrictsManager.php @@ -50,52 +50,6 @@ class CityDistrictsManager extends BaseFrameworkSystem implements ManageableCity // Return the prepared instance return $managerInstance; } - - /** - * Checks whether at least one map requires expansion - * - * @return $requiresExpansion Whether a map requires expansion - * @todo 0% done - */ - public function isMapPendingExpansion () { - // Default is no expansion is needed - $requireExpansion = FALSE; - - // First, a simple check if the districts table contains any entries at all - if ($this->getWrapperInstance()->countTotalRows() == 0) { - // This definedly requires expansion - $requireExpansion = TRUE; - } // END - if - - // Return status - return $requireExpansion; - } - - /** - * Expands any map that requires expansion - * - * @return void - * @todo ~10% done - * @todo z-coordinate not used - */ - public function expandMaps () { - // Get a city info wrapper instance - $cityWrapperInstance = DatabaseWrapperFactory::createWrapperByConfiguredName('city_info_db_wrapper_class'); - - // Get all city ids from it - $cityIds = $cityWrapperInstance->getAllCityIds(); - - // Now check all ids - foreach ($cityIds as $cityId) { - // Does this id have any districts - if (!$this->getWrapperInstance()->ifCityHasDistricts($cityId)) { - // Nothing found, so it is a brand-new city that needs first initialization - $districts = $this->getWrapperInstance()->doInitialCityExpansion($cityId); - } else { - // @TODO Maybe some expansion is needed - } - } // END - foreach - } } // [EOF] diff --git a/application/city/classes/manager/city_entities/lots/class_CityLotsManager.php b/application/city/classes/manager/city_entities/lots/class_CityLotsManager.php index f4a7e98..f38d1da 100644 --- a/application/city/classes/manager/city_entities/lots/class_CityLotsManager.php +++ b/application/city/classes/manager/city_entities/lots/class_CityLotsManager.php @@ -50,52 +50,6 @@ class CityLotsManager extends BaseFrameworkSystem implements ManageableCityLots, // Return the prepared instance return $managerInstance; } - - /** - * Checks whether at least one map requires expansion - * - * @return $requiresExpansion Whether a map requires expansion - * @todo 0% done - */ - public function isMapPendingExpansion () { - // Default is no expansion is needed - $requireExpansion = FALSE; - - // First, a simple check if the lots table contains any entries at all - if ($this->getWrapperInstance()->countTotalRows() == 0) { - // This definedly requires expansion - $requireExpansion = TRUE; - } // END - if - - // Return status - return $requireExpansion; - } - - /** - * Expands any map that requires expansion - * - * @return void - * @todo ~10% done - * @todo z-coordinate not used - */ - public function expandMaps () { - // Get a city info wrapper instance - $cityWrapperInstance = DatabaseWrapperFactory::createWrapperByConfiguredName('city_info_db_wrapper_class'); - - // Get all city ids from it - $cityIds = $cityWrapperInstance->getAllCityIds(); - - // Now check all ids - foreach ($cityIds as $cityId) { - // Does this id have any lots - if (!$this->getWrapperInstance()->ifCityHasLots($cityId)) { - // Nothing found, so it is a brand-new city that needs first initialization - $lots = $this->getWrapperInstance()->doInitialCityExpansion($cityId); - } else { - // @TODO Maybe some expansion is needed - } - } // END - foreach - } } // [EOF] diff --git a/application/city/interfaces/manager/city_entities/class_ManageableCityEntities.php b/application/city/interfaces/manager/city_entities/class_ManageableCityEntities.php index 127201a..8c68118 100644 --- a/application/city/interfaces/manager/city_entities/class_ManageableCityEntities.php +++ b/application/city/interfaces/manager/city_entities/class_ManageableCityEntities.php @@ -22,19 +22,6 @@ * along with this program. If not, see . */ interface ManageableCityEntities extends Manageable { - /** - * Checks whether at least one map requires expansion - * - * @return $requiresExpansion Whether a map requires expansion - */ - function isMapPendingExpansion (); - - /** - * Expands any map that requires expansion - * - * @return void - */ - function expandMaps (); } // [EOF]