X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fcity%2Fmain%2Fcity_daemon%2Fclass_BaseCityDaemon.php;h=ed5f3276af7ebe5b8b1a462925c7ac3ddc0ad820;hb=67e1a16e2bc085cd8cf8d5adadbb77fa23801ecc;hp=8735bbbadccccae017764edc1dc5f2858c7b22ac;hpb=4d1327ed3d552e76bcdb23d329a175dd7a823621;p=city.git diff --git a/application/city/main/city_daemon/class_BaseCityDaemon.php b/application/city/main/city_daemon/class_BaseCityDaemon.php index 8735bbb..ed5f327 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'; /** @@ -178,12 +179,12 @@ class BaseCityDaemon extends BaseCitySystem implements Updateable, AddableCriter // 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,24 @@ 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 + * @todo 0% done + */ + public function isMapPendingExpansion () { + // Get map manager + $mapInstance = ManagerFactory::createManagerByType('city_map'); - // Daemon has been fully initialized, so change state to 'virgin' - $this->getStateInstance()->daemonHasInitialized(); + // Call it's method and return value + return $mapInstance->isMapPendingExpansion(); } }