Class RandomSolver

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void disable()  
      void enable()  
      java.lang.String getDebugInfo()
      This will return state information about the solver useful for debugging
      java.lang.String getEventString()  
      int getMinimumRest()  
      boolean isEnabled()  
      boolean isForceDisable()  
      long lastRan()  
      void onFinish()
      Runs once at the end (when shouldExecute first returns false); This method can be optionally overridden
      abstract int onLoop()
      Runs as long as shouldExecute returns true; This method must be overridden
      void onPaint​(java.awt.Graphics graphics)
      Handles the graphic for the script.
      void onPaint​(java.awt.Graphics2D graphics)
      Handles the graphic for the script.
      void onStart()
      Runs once when the random solver first activates; This method can be optionally overridden
      void setForceDisable​(boolean forceDisable)  
      abstract boolean shouldExecute()
      Checks whether the random even solver should execute; This method must be overridden
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RandomSolver

        public RandomSolver​(RandomEvent event)
      • RandomSolver

        public RandomSolver​(java.lang.String eventString)
    • Method Detail

      • getDebugInfo

        public java.lang.String getDebugInfo()
        This will return state information about the solver useful for debugging
        Returns:
        state information about the solver
      • shouldExecute

        public abstract boolean shouldExecute()
        Checks whether the random even solver should execute; This method must be overridden
        Returns:
        true as long as the random executor should be executing
      • onStart

        public void onStart()
        Runs once when the random solver first activates; This method can be optionally overridden
      • onLoop

        public abstract int onLoop()
        Runs as long as shouldExecute returns true; This method must be overridden
        Returns:
        time to delay before next onLoop
      • onFinish

        public void onFinish()
        Runs once at the end (when shouldExecute first returns false); This method can be optionally overridden
      • getEventString

        public java.lang.String getEventString()
      • onPaint

        public void onPaint​(java.awt.Graphics graphics)
        Description copied from interface: PaintListener
        Handles the graphic for the script.
        Specified by:
        onPaint in interface PaintListener
        Parameters:
        graphics - The Graphics instance sent from the canvas.
      • onPaint

        public void onPaint​(java.awt.Graphics2D graphics)
        Description copied from interface: PaintListener
        Handles the graphic for the script.
        Specified by:
        onPaint in interface PaintListener
        Parameters:
        graphics - The Graphics instance sent from the canvas.
      • disable

        public void disable()
      • enable

        public void enable()
      • isEnabled

        public boolean isEnabled()
      • lastRan

        public long lastRan()
      • isForceDisable

        public boolean isForceDisable()
      • setForceDisable

        public void setForceDisable​(boolean forceDisable)
      • getMinimumRest

        public int getMinimumRest()