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