X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fcity%2Fmain%2Fcity_daemon%2Fclass_BaseCityDaemon.php;h=8584bebd2ac0ce840de6d382b2585e94f53ab6c7;hb=a4d43c71eff407c75cc8ed59bc382267c16ec52c;hp=661c6138b631840a5061c4592a5272620766e83e;hpb=7dbafe9738dfbc67b085ea983cc09c919a912fd6;p=city.git diff --git a/application/city/main/city_daemon/class_BaseCityDaemon.php b/application/city/main/city_daemon/class_BaseCityDaemon.php index 661c613..8584beb 100644 --- a/application/city/main/city_daemon/class_BaseCityDaemon.php +++ b/application/city/main/city_daemon/class_BaseCityDaemon.php @@ -25,6 +25,7 @@ class BaseCityDaemon extends BaseCitySystem implements Updateable, AddableCriter /** * City types */ + const CITY_TYPE_DEFAULT = 'default'; const CITY_TYPE_TESTING = 'testing'; /** @@ -171,19 +172,19 @@ class BaseCityDaemon extends BaseCitySystem implements Updateable, AddableCriter * @param $responseInstance A Responseable class * @return void */ - public function activateCity (Requestable $requestInstance, Responseable $responseInstance) { + public function activateCityDaemon (Requestable $requestInstance, Responseable $responseInstance) { // Get the controller here $controllerInstance = Registry::getRegistry()->getInstance('controller'); // Run all filters for the City activation $controllerInstance->executeActivationFilters($requestInstance, $responseInstance); - // Make sure the city's state is 'virigin' - $this->getStateInstance()->validateCityStateIsVirgin(); + // Make sure the city's state is 'init' + $this->getStateInstance()->validateCityStateIsInit(); // ----------------------- Last step from here ------------------------ - // Activate the City. This is ALWAYS the last step in this method - /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CITY[' . __METHOD__ . ':' . __LINE__ . ']: state=' . $this->getStateInstance()->__toString()); + // Activate the city daemon. This is ALWAYS the last step in this method + /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CITY[' . __METHOD__ . ':' . __LINE__ . ']: state=' . $this->getStateInstance()->__toString() . ' - Activating ...'); $this->getStateInstance()->citySimulationIsActivated(); // ---------------------- Last step until here ------------------------ } @@ -243,12 +244,36 @@ class BaseCityDaemon extends BaseCitySystem implements Updateable, AddableCriter * Initializes the city daemon * * @return void + * @todo 0% done */ public function bootstrapInitCityDaemon () { $this->partialStub('Please add something here.'); + } + + /** + * Checks whether at least one map requires expansion + * + * @return $requiresExpansion Whether a map requires expansion + */ + public function isMapPendingExpansion () { + // Get sections manager + $sectionsInstance = ManagerFactory::createManagerByType('city_sections'); + + // Call it's method and return value + return $sectionsInstance->isMapPendingExpansion(); + } + + /** + * Expands any found map that requires expansion + * + * @return void + */ + public function expandMaps () { + // Get sections manager + $sectionsInstance = ManagerFactory::createManagerByType('city_sections'); - // Daemon has been fully initialized, so change state to 'virgin' - $this->getStateInstance()->daemonHasInitialized(); + // Call it's method and return value + $sectionsInstance->expandMaps(); } }