*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2014 Core Developer Team
+ * @copyright Copyright (c) 2014, 2015 Hub Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
* given crawler instance.
*
* @param $stateName Name of the state
- * @param $crawlerInstance A Crawler class instance
* @return $stateInstance A Stateable class instance
*/
- public static final function createCrawlerStateInstanceByName ($stateName, Crawler $crawlerInstance) {
+ public static final function createCrawlerStateInstanceByName ($stateName) {
// Then construct the class' configuraton entry
$className = 'crawler_' . $stateName . '_state_class';
// Get a class from that configuration entry
- $stateInstance = self::createObjectByConfiguredName($className, array($crawlerInstance));
+ $stateInstance = self::createObjectByConfiguredName($className);
+
+ // Get crawler instance
+ $crawlerInstance = Registry::getRegistry()->getInstance('crawler');
// Debug message
self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-STATE-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Crawler state has changed from ' . $crawlerInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.');