]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Haeder <roland@mxchange.org>
Wed, 25 Jun 2014 17:50:41 +0000 (19:50 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 25 Jun 2014 17:52:38 +0000 (19:52 +0200)
- added a Minable interface for minable blocks
- added a HashBlock class which can be "mined"
- added missing debug output in some state factories
- added 'booting' state for block miners
- used updated 'core'

Signed-off-by: Roland Haeder <roland@mxchange.org>
23 files changed:
application/hub/config.php
application/hub/interfaces/blocks/.htaccess [new file with mode: 0644]
application/hub/interfaces/blocks/class_Minable.php [new file with mode: 0644]
application/hub/interfaces/miner/class_MinerHelper.php
application/hub/interfaces/states/node/.htaccess [deleted file]
application/hub/interfaces/states/node/class_NodeStateable.php [deleted file]
application/hub/main/blocks/.htaccess [new file with mode: 0644]
application/hub/main/blocks/class_ [new file with mode: 0644]
application/hub/main/blocks/class_BaseBlock.php [new file with mode: 0644]
application/hub/main/blocks/miner/.htaccess [new file with mode: 0644]
application/hub/main/blocks/miner/class_HashBlock.php [new file with mode: 0644]
application/hub/main/factories/states/crawler/class_CrawlerStateFactory.php
application/hub/main/factories/states/cruncher/class_CruncherStateFactory.php
application/hub/main/factories/states/miner/class_MinerStateFactory.php
application/hub/main/miner/class_BaseHubMiner.php
application/hub/main/producer/miner/blocks/class_MinerTestGenesisBlockProducer.php
application/hub/main/states/miner/booting/.htaccess [new file with mode: 0644]
application/hub/main/states/miner/booting/class_MinerBootingState.php [new file with mode: 0644]
application/hub/main/states/miner/class_ [deleted file]
application/hub/main/states/miner/class_BaseMinerState.php
application/hub/main/states/miner/class_Miner [new file with mode: 0644]
application/hub/main/states/miner/init/class_MinerInitState.php
core

index 2a93d314398aa06b775c6a27ce563874fe95dc39..c4b77f9af9eed4489412c9cb3bd2396b18c4348f 100644 (file)
@@ -959,6 +959,9 @@ $cfg->setConfigEntry('miner_shutdown_filter', 'MinerShutdownFilter');
 // CFG: MINER-INIT-STATE-CLASS
 $cfg->setConfigEntry('miner_init_state_class', 'MinerInitState');
 
+// CFG: MINER-BOOTING-STATE-CLASS
+$cfg->setConfigEntry('miner_booting_state_class', 'MinerBootingState');
+
 // CFG: MINER-BLOCK-FETCHER-TASK-CLASS
 $cfg->setConfigEntry('miner_block_fetcher_task_class', 'MinerBlockFetcherTask');
 
@@ -1001,6 +1004,9 @@ $cfg->setConfigEntry('miner_test_genesis_block_producer_class', 'MinerTestGenesi
 // CFG: MINER-NODE-COMMUNICATOR-CLASS
 $cfg->setConfigEntry('miner_node_communicator_class', 'MinerNodeCommunicator');
 
+// CFG: MINER-TEST-HASH-BLOCK-CLASS
+$cfg->setConfigEntry('miner_test_hash_block_class', 'HashBlock');
+
 ///////////////////////////////////////////////////////////////////////////////
 //                        Cruncher configuration
 ///////////////////////////////////////////////////////////////////////////////
@@ -1271,9 +1277,6 @@ $cfg->setConfigEntry('crawler_url_rss_start_stack_class', 'FiFoFileStack');
 // CFG: CRAWLER-URL-FOUND-RSS-STACK-CLASS
 $cfg->setConfigEntry('crawler_url_found_rss_stack_class', 'FiFoFileStack');
 
-// CFG: TEST-BLOCK-MINER-STACK-CLASS
-$cfg->setConfigEntry('test_block_miner_stack_class', 'FiFoFileStack');
-
 // CFG: CRAWLER-URL-LOCAL-START-FILE-STACK-INDEX-CLASS
 $cfg->setConfigEntry('crawler_url_local_start_file_stack_index_class', 'FileStackIndex');
 
@@ -1286,9 +1289,6 @@ $cfg->setConfigEntry('crawler_url_rss_start_file_stack_index_class', 'FileStackI
 // CFG: CRAWLER-URL-FOUND-RSS-FILE-STACK-INDEX-CLASS
 $cfg->setConfigEntry('crawler_url_found_rss_file_stack_index_class', 'FileStackIndex');
 
-// CFG: TEST-BLOCK-MINER-FILE-STACK-INDEX-CLASS
-$cfg->setConfigEntry('test_block_miner_file_stack_index_class', 'FileStackIndex');
-
 // CFG: TASK-CRAWLER-NODE-COMMUNICATOR-STARTUP-DELAY
 $cfg->setConfigEntry('task_crawler_node_communicator_startup_delay', 500);
 
diff --git a/application/hub/interfaces/blocks/.htaccess b/application/hub/interfaces/blocks/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/blocks/class_Minable.php b/application/hub/interfaces/blocks/class_Minable.php
new file mode 100644 (file)
index 0000000..1967a41
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+/**
+ * An interface for minable (blocks)
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2014 Miner Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ * @todo               We need to find a better name for this interface
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Minable extends FrameworkInterface {
+}
+
+// [EOF]
+?>
index 4f1daedafe0c8be12679777b81d0779b5b49960e..18e1b651ec6db9ee5ba412542654ab9bc17d02c0 100644 (file)
@@ -79,6 +79,14 @@ interface MinerHelper extends FrameworkInterface {
         * @return      void
         */
        function initBufferQueues ();
+
+       /**
+        * Changes the state to 'booting' and shall be called after the block
+        * producer has been initialized.
+        *
+        * @return      void
+        */
+       function blockProducerHasInitialized ();
 }
 
 // [EOF]
diff --git a/application/hub/interfaces/states/node/.htaccess b/application/hub/interfaces/states/node/.htaccess
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/application/hub/interfaces/states/node/class_NodeStateable.php b/application/hub/interfaces/states/node/class_NodeStateable.php
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/application/hub/main/blocks/.htaccess b/application/hub/main/blocks/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/blocks/class_ b/application/hub/main/blocks/class_
new file mode 100644 (file)
index 0000000..f575db8
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * A ??? block class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class ???Block extends BaseBlock implements === {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $blockInstance  An instance of a === class
+        */
+       public final static function create???Block () {
+               // Get new instance
+               $blockInstance = new ???Block();
+
+               // Return the prepared instance
+               return $blockInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/blocks/class_BaseBlock.php b/application/hub/main/blocks/class_BaseBlock.php
new file mode 100644 (file)
index 0000000..9c9b78c
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * A general Block class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseBlock extends BaseHubSystem {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/blocks/miner/.htaccess b/application/hub/main/blocks/miner/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/blocks/miner/class_HashBlock.php b/application/hub/main/blocks/miner/class_HashBlock.php
new file mode 100644 (file)
index 0000000..53e61a3
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * A Hash block class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class HashBlock extends BaseBlock implements Minable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $blockInstance  An instance of a Minable class
+        */
+       public final static function createHashBlock () {
+               // Get new instance
+               $blockInstance = new HashBlock();
+
+               // Return the prepared instance
+               return $blockInstance;
+       }
+}
+
+// [EOF]
+?>
index 7b4c6750a13bf8f0ff34b86ec67ac701c0bd735c..29021d3cb82ee162cf5271f7d892efce1c87ac74 100644 (file)
@@ -36,9 +36,9 @@ class CrawlerStateFactory extends ObjectFactory {
         * Creates an instance of a configurable crawler state and sets it in the
         * given crawler instance.
         *
-        * @param       $stateName                              Name of the state
+        * @param       $stateName                      Name of the state
         * @param       $crawlerInstance        A Crawler class instance
-        * @return      $stateInstance                  A Stateable class instance
+        * @return      $stateInstance          A Stateable class instance
         */
        public static final function createCrawlerStateInstanceByName ($stateName, Crawler $crawlerInstance) {
                // Then construct the class' configuraton entry
index 2d2700a5cc6f09f3f9f468410a6388a233fc80a7..ce1963bc563f998e8c6f30a97893a38578fc2fd1 100644 (file)
@@ -36,9 +36,9 @@ class CruncherStateFactory extends ObjectFactory {
         * Creates an instance of a configurable cruncher state and sets it in the
         * given cruncher instance.
         *
-        * @param       $stateName              Name of the state
+        * @param       $stateName                      Name of the state
         * @param       $cruncherInstance       A CruncherHelper class instance
-        * @return      $stateInstance  A Stateable class instance
+        * @return      $stateInstance          A Stateable class instance
         */
        public static final function createCruncherStateInstanceByName ($stateName, CruncherHelper $cruncherInstance) {
                // Then construct the class' configuraton entry
@@ -47,6 +47,9 @@ class CruncherStateFactory extends ObjectFactory {
                // Get a class from that configuration entry
                $stateInstance = self::createObjectByConfiguredName($className, array($cruncherInstance));
 
+               // Debug message
+               self::createDebugInstance(__CLASS__)->debugOutput('CRUNCHER-STATE-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Cruncher state has changed from ' . $nodeInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.');
+
                // Once we have that state, set it in the cruncher instance
                $cruncherInstance->setStateInstance($stateInstance);
 
index 5120f3da1d0104731ca935cd1464764ab52ad5ee..b947915c54868e0addfeadc6093c884783ceebde 100644 (file)
@@ -47,6 +47,9 @@ class MinerStateFactory extends ObjectFactory {
                // Get a class from that configuration entry
                $stateInstance = self::createObjectByConfiguredName($className, array($minerInstance));
 
+               // Debug message
+               self::createDebugInstance(__CLASS__)->debugOutput('MINER-STATE-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Miner state has changed from ' . $minerInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.');
+
                // Once we have that state, set it in the miner instance
                $minerInstance->setStateInstance($stateInstance);
 
index 27ac974e8e11e092f713f5466df8b5d6bca9c3dd..13473eb73deadcaa4a9616904cb124b8752efc4d 100644 (file)
@@ -204,6 +204,20 @@ abstract class BaseHubMiner extends BaseHubSystem implements Updateable {
                $this->partialStub('Unfinished!');
                return;
        }
+
+       /**
+        * Changes the state to 'booting' and shall be called after the block
+        * producer has been initialized.
+        *
+        * @return      void
+        */
+       public function blockProducerHasInitialized () {
+               // Make sure the state is correct ('init')
+               $this->getStateInstance()->validateMinerStateIsInit();
+
+               // Change it to 'booting'
+               MinerStateFactory::createMinerStateInstanceByName('booting', $this);
+       }
 }
 
 // [EOF]
index ed35b19667eb5f1325f56420cc1f2efc5cbb31cb..e0329ac3ab13a3926844834fb574939b267ee2de 100644 (file)
@@ -41,11 +41,11 @@ class MinerTestGenesisBlockProducer extends BaseBlockProducer implements BlockPr
                // Get new instance
                $producerInstance = new MinerTestGenesisBlockProducer();
 
-               // Init the queue for this test block producer
-               $stackInstance = FileStackFactory::createFileStackInstance('test', 'block_miner');
+               // Get a (minable) hash block instance
+               $minableInstance = ObjectFactory::createObjectByConfiguredName('miner_test_hash_block_class');
 
                // Set it here
-               $producerInstance->setStackInstance($stackInstance);
+               $producerInstance->setMinableInstance($minableInstance);
 
                // Return the prepared instance
                return $producerInstance;
@@ -60,6 +60,12 @@ class MinerTestGenesisBlockProducer extends BaseBlockProducer implements BlockPr
         */
        protected function initProducer () {
                $this->partialStub('Please implement this method.');
+
+               // As last step, change the state of the miner, get the miner first
+               $minerInstance = Registry::getRegistry()->getInstance('miner');
+
+               // Change state to next state
+               $minerInstance->blockProducerHasInitialized();
        }
 
        /**
diff --git a/application/hub/main/states/miner/booting/.htaccess b/application/hub/main/states/miner/booting/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/states/miner/booting/class_MinerBootingState.php b/application/hub/main/states/miner/booting/class_MinerBootingState.php
new file mode 100644 (file)
index 0000000..4c3ddd8
--- /dev/null
@@ -0,0 +1,71 @@
+<?php
+/**
+ * A Booting miner state class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2014 Miner Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class MinerBootingState extends BaseMinerState implements Stateable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set state name
+               $this->setStateName('booting');
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $minerInstance  An instance of a MinerHelper class
+        * @return      $stateInstance  An instance of a Stateable class
+        */
+       public final static function createMinerBootingState (MinerHelper $minerInstance) {
+               // Get new instance
+               $stateInstance = new MinerBootingState();
+
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('MINER-STATE: Has changed from ' . $minerInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.');
+
+               // Set the miner instance
+               $stateInstance->setMinerInstance($minerInstance);
+
+               // Return the prepared instance
+               return $stateInstance;
+       }
+
+       /**
+        * Executes the state with given Executor instance
+        *
+        * @param       $executorInstance       An instance of a Executor class
+        * @return      void
+        */
+       public function executeState (Executor $executorInstance) {
+               // Now prepare the unit production to maybe become 'virgin' or 'active' if work/test units are there
+               $executorInstance->prepareBlockProduction($this);
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/states/miner/class_ b/application/hub/main/states/miner/class_
deleted file mode 100644 (file)
index b2020ce..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-<?php
-/**
- * A ??? miner state class
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2014 Miner Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-class Miner???State extends BaseMinerState implements Stateable {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-
-               // Set state name
-               $this->setStateName('!!!');
-       }
-
-       /**
-        * Creates an instance of this class
-        *
-        * @param       $minerInstance  An instance of a MinerHelper class
-        * @return      $stateInstance  An instance of a Stateable class
-        */
-       public final static function createMiner???State (MinerHelper $minerInstance) {
-               // Get new instance
-               $stateInstance = new Miner???State();
-
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('MINER-STATE: Has changed from ' . $minerInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.');
-
-               // Set the miner instance
-               $stateInstance->setMinerInstance($minerInstance);
-
-               // Return the prepared instance
-               return $stateInstance;
-       }
-
-       /**
-        * Executes the state with given Executor instance
-        *
-        * @param       $executorInstance       An instance of a Executor class
-        * @return      void
-        */
-       public function executeState (Executor $executorInstance) {
-               $this->partialStub('This state needs implementation. executorInstance=' . $executorInstance->__toString());
-       }
-}
-
-// [EOF]
-?>
index e1a0ed334c1a6945832acb18931b6e5e00e2b1be..891a7221d0a2e46bb00d8b61b3d788b94d8da16a 100644 (file)
@@ -48,6 +48,21 @@ class BaseMinerState extends BaseState {
                } // END - if
        }
 
+       /**
+        * Validates whether the state is 'init' or throws an exception if
+        * it is every other state.
+        *
+        * @return      void
+        * @throws      InvalidStateException   If the state is not 'init'
+        */
+       public function validateMinerStateIsInit () {
+               // Just compare it...
+               if (!$this instanceof MinerInitState) {
+                       // Throw the exception
+                       throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE);
+               } // END - if
+       }
+
        /**
         * Checks if this state is 'virgin'
         *
diff --git a/application/hub/main/states/miner/class_Miner b/application/hub/main/states/miner/class_Miner
new file mode 100644 (file)
index 0000000..b2020ce
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+/**
+ * A ??? miner state class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2014 Miner Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class Miner???State extends BaseMinerState implements Stateable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set state name
+               $this->setStateName('!!!');
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $minerInstance  An instance of a MinerHelper class
+        * @return      $stateInstance  An instance of a Stateable class
+        */
+       public final static function createMiner???State (MinerHelper $minerInstance) {
+               // Get new instance
+               $stateInstance = new Miner???State();
+
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('MINER-STATE: Has changed from ' . $minerInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.');
+
+               // Set the miner instance
+               $stateInstance->setMinerInstance($minerInstance);
+
+               // Return the prepared instance
+               return $stateInstance;
+       }
+
+       /**
+        * Executes the state with given Executor instance
+        *
+        * @param       $executorInstance       An instance of a Executor class
+        * @return      void
+        */
+       public function executeState (Executor $executorInstance) {
+               $this->partialStub('This state needs implementation. executorInstance=' . $executorInstance->__toString());
+       }
+}
+
+// [EOF]
+?>
index 14caefed5dcdd67c5944a1e02cdbf4533bc8d577..c8694a15c20ce5ea89fb019e58a440e7f49fc8cd 100644 (file)
@@ -57,10 +57,9 @@ class MinerInitState extends BaseMinerState implements Stateable {
         *
         * @param       $executorInstance       An instance of a Executor class
         * @return      void
+        * @todo        0% done?
         */
        public function executeState (Executor $executorInstance) {
-               // Now prepare the unit production to maybe become 'virgin' or 'active' if work/test units are there
-               $executorInstance->prepareBlockProduction($this);
        }
 
        /**
diff --git a/core b/core
index d5cbb96707ecc0630c05da880205f2c7f26e623b..1efa4dc3d8bd367e85e5cecf13778d06e0418415 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit d5cbb96707ecc0630c05da880205f2c7f26e623b
+Subproject commit 1efa4dc3d8bd367e85e5cecf13778d06e0418415