]> git.mxchange.org Git - city.git/blob - application/city/classes/city_daemon/default/class_SimulationDefaultCityDaemon.php
dcfe72600b15d63da08535fe74f00229724627dc
[city.git] / application / city / classes / city_daemon / default / class_SimulationDefaultCityDaemon.php
1 <?php
2 // Own namespace
3 namespace Org\Mxchange\City\Daemon\Simulation;
4
5 // Import application-specific stuff
6 use Org\Mxchange\City\Daemon\BaseCityDaemon;
7 use Org\Mxchange\City\Helper\CityHelper;
8
9 // Import framework stuff
10 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
11 use Org\Mxchange\CoreFramework\Handler\Task\HandleableTask;
12 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
13 use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
14 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
15 use Org\Mxchange\CoreFramework\Registry\Registerable;
16 use Org\Mxchange\CoreFramework\Request\Requestable;
17
18 /**
19  * The default city daemon
20  *
21  * @author              Roland Haeder <webmaster@shipsimu.org>
22  * @version             0.0.0
23  * @copyright   Copyright (c) 2015 - 2023 City Developer Team
24  * @license             GNU GPL 3.0 or any newer version
25  * @link                http://www.shipsimu.org
26  *
27  * This program is free software: you can redistribute it and/or modify
28  * it under the terms of the GNU General Public License as published by
29  * the Free Software Foundation, either version 3 of the License, or
30  * (at your option) any later version.
31  *
32  * This program is distributed in the hope that it will be useful,
33  * but WITHOUT ANY WARRANTY; without even the implied warranty of
34  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
35  * GNU General Public License for more details.
36  *
37  * You should have received a copy of the GNU General Public License
38  * along with this program. If not, see <http://www.gnu.org/licenses/>.
39  */
40 class SimulationDefaultCityDaemon extends BaseCityDaemon implements CityHelper, Registerable {
41         /**
42          * Protected constructor
43          *
44          * @return      void
45          */
46         protected function __construct () {
47                 // Call parent constructor
48                 parent::__construct(__CLASS__);
49         }
50
51         /**
52          * Creates an instance of this hub-node class
53          *
54          * @return      $nodeInstance           An instance of this hub-node class
55          */
56         public static final function createSimulationDefaultCityDaemon () {
57                 // Get a new instance
58                 $nodeInstance = new SimulationDefaultCityDaemon();
59
60                 // Return the instance
61                 return $nodeInstance;
62         }
63
64         /**
65          * Method to "bootstrap" the city simulation. This step does also apply
66          * provided command-line arguments stored in the request instance.
67          *
68          * @return      void
69          * @todo        Implement this method
70          */
71         public function doBootstrapping () {
72                 DebugMiddleware::getSelfInstance()->partialStub();
73         }
74
75         /**
76          * Add some node-specific filters
77          *
78          * @return      void
79          */
80         public function addExtraCityFilters () {
81                 // Get the application instance from registry
82                 $applicationInstance = ApplicationHelper::getSelfInstance();
83
84                 // Get the controller from the application
85                 $controllerInstance = $applicationInstance->getControllerInstance();
86
87                 // Foo task
88                 // @TODO $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('city_foo_task_filter_class'));
89
90                 // @TODO Add some filters here
91                 DebugMiddleware::getSelfInstance()->partialStub('Add some filters here.');
92         }
93
94         /**
95          * Adds extra tasks to the given handler for this node
96          *
97          * @param       $handlerInstance        An instance of a HandleableTask class
98          * @return      void
99          * @todo        0% done
100          */
101         public function addExtraTasks (HandleableTask $handlerInstance) {
102                 DebugMiddleware::getSelfInstance()->partialStub('Please add some tasks or empty this method.');
103         }
104 }