]> 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 891a7221d0a2e46bb00d8b61b3d788b94d8da16a..0208d7a2cee02e901ea7aa36f07e4ae7e66ac18f 100644 (file)
@@ -63,6 +63,21 @@ class BaseMinerState extends BaseState {
                } // END - if
        }
 
+       /**
+        * Validates whether the state is 'booting' or throws an exception if
+        * it is every other state.
+        *
+        * @return      void
+        * @throws      InvalidStateException   If the state is not 'booting'
+        */
+       public function validateMinerStateIsBooting () {
+               // Just compare it...
+               if (!$this instanceof MinerBootingState) {
+                       // Throw the exception
+                       throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE);
+               } // END - if
+       }
+
        /**
         * Checks if this state is 'virgin'
         *