3 namespace Org\Mxchange\City\State\Init;
5 // Import application-specific stuff
6 use Org\Mxchange\City\Factory\State\CityStateFactory;
7 use Org\Mxchange\City\State\BaseCityState;
9 // Import framework stuff
10 use Org\Mxchange\CoreFramework\Executor\Executor;
11 use Org\Mxchange\CoreFramework\State\Stateable;
14 * A init city state class
16 * @author Roland Haeder <webmaster@shipsimu.org>
18 * @copyright Copyright (c) 2015 - 2023 City Developer Team
19 * @license GNU GPL 3.0 or any newer version
20 * @link http://www.shipsimu.org
22 * This program is free software: you can redistribute it and/or modify
23 * it under the terms of the GNU General Public License as published by
24 * the Free Software Foundation, either version 3 of the License, or
25 * (at your option) any later version.
27 * This program is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU General Public License for more details.
32 * You should have received a copy of the GNU General Public License
33 * along with this program. If not, see <http://www.gnu.org/licenses/>.
35 class CityInitState extends BaseCityState implements Stateable {
37 * Protected constructor
41 protected function __construct () {
42 // Call parent constructo
43 parent::__construct(__CLASS__);
46 $this->setStateName('init');
50 * Creates an instance of this class
52 * @return $stateInstance An instance of a Stateable class
54 public static final function createCityInitState () {
56 $stateInstance = new CityInitState();
58 // Return the prepared instance
59 return $stateInstance;
63 * Executes the state with given Executor instance
65 * @param $executorInstance An instance of a Executor class
68 public function executeState (Executor $executorInstance) {
69 // Initialize the daemon
70 $executorInstance->initializeDaemon($this);
74 * Change the state to 'active' when the city daemon has initialized all
79 public function citySimulationIsActivated () {
80 // Create the new state instance
81 CityStateFactory::createCityStateInstanceByName('active');