// Output all lines
self::createDebugInstance(__CLASS__)->debugOutput(' ');
- self::createDebugInstance(__CLASS__)->debugOutput($app->getAppName() . ' v' . $app->getAppVersion() . ' - ' . $this->getRequestInstance()->getRequestElement('mode') . ' mode active');
- self::createDebugInstance(__CLASS__)->debugOutput('Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2015 City Developer Team');
+ self::createDebugInstance(__CLASS__)->debugOutput($app->getAppName() . ' v' . $app->getAppVersion() . ' - ' . $this->getRequestInstance()->getRequestElement('mode') . ' daemon starting');
+ self::createDebugInstance(__CLASS__)->debugOutput('Copyright (c) 2015 City Developer Team');
self::createDebugInstance(__CLASS__)->debugOutput(' ');
self::createDebugInstance(__CLASS__)->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.');
self::createDebugInstance(__CLASS__)->debugOutput('This is free software, and you are welcome to redistribute it under certain');
assert($requestInstance instanceof Requestable);
// Add City number and type
- $criteriaInstance->addCriteria(CityInformationDatabaseWrapper::DB_COLUMN_CITY_NR , 1);
+ $criteriaInstance->addCriteria(CityInformationDatabaseWrapper::DB_COLUMN_CITY_ID , 1);
$criteriaInstance->addCriteria(CityInformationDatabaseWrapper::DB_COLUMN_CITY_MODE, $requestInstance->getRequestElement('mode'));
// Add the City id
// Run all filters for the City activation
$controllerInstance->executeActivationFilters($requestInstance, $responseInstance);
+ // Make sure the city's state is 'virigin'
+ assert($this->getStateInstance()->validateCityStateIsVirgin() === TRUE);
+
// ----------------------- Last step from here ------------------------
// Activate the City. This is ALWAYS the last step in this method
- $this->getStateInstance()->activateCitySimulation();
+ /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CITY[' . __METHOD__ . ':' . __LINE__ . ']: state=' . $this->getStateInstance()->__toString());
+ $this->getStateInstance()->citySimulationIsActivated();
// ---------------------- Last step until here ------------------------
}
* @param $CityData An array with valid City data
* @return void
*/
- public function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $CityData) {
+ public function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $cityData) {
// Add all data the array provides
- foreach (CityDistributedHashTableDatabaseWrapper::getAllElements() as $element) {
+ foreach (CityInformationDatabaseWrapper::getAllElements() as $element) {
// Is the element there?
- if (isset($CityData[$element])) {
+ if (isset($cityData[$element])) {
// Add it
- $dataSetInstance->addCriteria($element, $CityData[$element]);
+ $dataSetInstance->addCriteria($element, $cityData[$element]);
} else {
// Output warning message
- /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('City[' . __METHOD__ . ':' . __LINE__ . ']: addArrayToDataSet(): Element ' . $element . ' not found in CityData array.');
+ /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CITY[' . __METHOD__ . ':' . __LINE__ . ']: addArrayToDataSet(): Element ' . $element . ' not found in CityData array.');
}
} // END - foreac
}