// 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]
// 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]
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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]