3 namespace Org\Mxchange\City\Daemon\Simulation;
6 use Org\Mxchange\City\Daemon\BaseCityDaemon;
7 use Org\Mxchange\City\Helper\CityHelper;
9 // Import framework stuff
10 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
11 use Org\Mxchange\CoreFramework\Handler\Task\HandleableTask;
12 use Org\Mxchange\CoreFramework\Registry\Registry;
13 use Org\Mxchange\CoreFramework\Request\Requestable;
16 * The default city daemon
18 * @author Roland Haeder <webmaster@shipsimu.org>
20 * @copyright Copyright (c) 2015, 2016 City Developer Team
21 * @license GNU GPL 3.0 or any newer version
22 * @link http://www.shipsimu.org
24 * This program is free software: you can redistribute it and/or modify
25 * it under the terms of the GNU General Public License as published by
26 * the Free Software Foundation, either version 3 of the License, or
27 * (at your option) any later version.
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
34 * You should have received a copy of the GNU General Public License
35 * along with this program. If not, see <http://www.gnu.org/licenses/>.
37 class SimulationDefaultCityDaemon extends BaseCityDaemon implements CityHelper, Registerable {
39 * Protected constructor
43 protected function __construct () {
44 // Call parent constructor
45 parent::__construct(__CLASS__);
49 * Creates an instance of this hub-node class
51 * @param $requestInstance An instance of a Requestable class
52 * @return $nodeInstance An instance of this hub-node class
54 public static final function createSimulationDefaultCityDaemon (Requestable $requestInstance) {
56 $nodeInstance = new SimulationDefaultCityDaemon();
58 // Set the request instance
59 $nodeInstance->setRequestInstance($requestInstance);
61 // Return the instance
66 * Method to "bootstrap" the city simulation. This step does also apply
67 * provided command-line arguments stored in the request instance.
70 * @todo Implement this method
72 public function doBootstrapping () {
77 * Add some node-specific filters
81 public function addExtraCityFilters () {
82 // Get the application instance from registry
83 $applicationInstance = Registry::getRegistry()->getInstance('app');
85 // Get the controller from the application
86 $controllerInstance = $applicationInstance->getControllerInstance();
89 // @TODO $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('city_foo_task_filter'));
91 // @TODO Add some filters here
92 $this->partialStub('Add some filters here.');
96 * Adds extra tasks to the given handler for this node
98 * @param $handlerInstance An instance of a HandleableTask class
102 public function addExtraTasks (HandleableTask $handlerInstance) {
103 $this->partialStub('Please add some tasks or empty this method.');