Class AbstractScript

    • Constructor Detail

      • AbstractScript

        public AbstractScript()
    • Method Detail

      • getStartTile

        public Tile getStartTile()
      • getRandomThread

        public java.lang.Thread getRandomThread()
      • onStart

        public void onStart()
        Called when the script starts with no script parameters passed in.
      • onStart

        public void onStart​(java.lang.String... params)
        Called when the script is started with parameters
      • onSolverStart

        public boolean onSolverStart​(RandomSolver solver)
        Called during the random solver reset stage, before solver.onStart is called. Must return true in order for the solver.onStart to be called, and the solver to begin.
        solver - The Random Solver that is about to be activated
        True starts the solver, false will delay the start.
      • onLoop

        public abstract int onLoop()
        This is the script's primary loop that runs as long as the script does.
        How long to wait in milliseconds before onLoop is called again. Note that returning a number less than 0 will result in the script being stopped.
      • onExit

        public void onExit()
        Called when the script ends.
      • onPause

        public void onPause()
        Called when the script is paused.
      • onResume

        public void onResume()
        Called when the script is resumed.
      • onPaint

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

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

        public final void buildRandomManager()
        Creates the random manager and thread for this script
      • stop

        public void stop()
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • isPaused

        public boolean isPaused()
      • getVersion

        public double getVersion()
      • getSDNName

        public java.lang.String getSDNName()
      • getThreadURL

        public java.lang.String getThreadURL()
      • getStoreId

        public int getStoreId()
      • getSDNParameters

        public java.lang.String getSDNParameters()
        This is arbitrary data you've included in the SDN as a String

        You can use this as a way to differentiate between scripts with a similar code base, such as a basic and advanced version, without needing to maintain two separate (but extremely similar) script repos/modules.

        The script parameters you've set on the SDN for this script, only shown during runs loaded from the SDN. If no parameters have been set, it will return an empty string.