]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/states/miner/class_BaseMinerState.php
Continued:
[hub.git] / application / hub / main / states / miner / class_BaseMinerState.php
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'
         *