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