From f92d8f136666ca06aaa9c71fcb15c042687b4a07 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Wed, 1 Jul 2015 03:09:18 +0200 Subject: [PATCH] Added city map manager + own interface + expanded interface Signed-off-by: Roland Haeder --- .../helper/city/class_CityHelper.php | 7 +++ .../city/interfaces/manager/map/.htaccess | 1 + .../manager/map/class_ManageableMap.php | 28 +++++++++++ .../main/city_daemon/class_BaseCityDaemon.php | 13 +++++ .../city/main/manager/city_map/.htaccess | 1 + .../manager/city_map/class_CityMapManager.php | 50 +++++++++++++++++++ application/city/main/manager/class_ | 2 +- 7 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 application/city/interfaces/manager/map/.htaccess create mode 100644 application/city/interfaces/manager/map/class_ManageableMap.php create mode 100644 application/city/main/manager/city_map/.htaccess create mode 100644 application/city/main/manager/city_map/class_CityMapManager.php diff --git a/application/city/interfaces/helper/city/class_CityHelper.php b/application/city/interfaces/helper/city/class_CityHelper.php index 2883ae6..83321b1 100644 --- a/application/city/interfaces/helper/city/class_CityHelper.php +++ b/application/city/interfaces/helper/city/class_CityHelper.php @@ -77,6 +77,13 @@ interface CityHelper extends Helper, AddableCriteria { * @return void */ function addExtraTasks (HandleableTask $handlerInstance); + + /** + * Checks whether at least one map requires expansion + * + * @return $requiresExpansion Whether a map requires expansion + */ + function isMapPendingExpansion (); } // [EOF] diff --git a/application/city/interfaces/manager/map/.htaccess b/application/city/interfaces/manager/map/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/city/interfaces/manager/map/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/city/interfaces/manager/map/class_ManageableMap.php b/application/city/interfaces/manager/map/class_ManageableMap.php new file mode 100644 index 0000000..fdea29d --- /dev/null +++ b/application/city/interfaces/manager/map/class_ManageableMap.php @@ -0,0 +1,28 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2015 City Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +interface ManageableMap extends FrameworkInterface { +} + +// [EOF] +?> diff --git a/application/city/main/city_daemon/class_BaseCityDaemon.php b/application/city/main/city_daemon/class_BaseCityDaemon.php index 23d7fac..3aeadce 100644 --- a/application/city/main/city_daemon/class_BaseCityDaemon.php +++ b/application/city/main/city_daemon/class_BaseCityDaemon.php @@ -249,6 +249,19 @@ class BaseCityDaemon extends BaseCitySystem implements Updateable, AddableCriter 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'); + + $this->partialStub('Please add something here.'); + } } // [EOF] diff --git a/application/city/main/manager/city_map/.htaccess b/application/city/main/manager/city_map/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/city/main/manager/city_map/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/city/main/manager/city_map/class_CityMapManager.php b/application/city/main/manager/city_map/class_CityMapManager.php new file mode 100644 index 0000000..2b5cbe1 --- /dev/null +++ b/application/city/main/manager/city_map/class_CityMapManager.php @@ -0,0 +1,50 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2015 City Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class CityMapManager extends BaseFrameworkSystem implements ManageableMap, Registerable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @return $managerInstance An instance of a ManageableMap class + */ + public final static function createCityMapManager () { + // Get new instance + $managerInstance = new CityMapManager(); + + // Return the prepared instance + return $managerInstance; + } +} + +// [EOF] +?> diff --git a/application/city/main/manager/class_ b/application/city/main/manager/class_ index e302a4b..be19c93 100644 --- a/application/city/main/manager/class_ +++ b/application/city/main/manager/class_ @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class ???Manager extends BaseFrameworkSystem implements Manageable??? { +class ???Manager extends BaseFrameworkSystem implements Manageable???, Registerable { /** * Protected constructor * -- 2.39.5