Class Context

java.lang.Object
com.xebisco.yield.Context
All Implemented Interfaces:
Runnable

public class Context extends Object implements Runnable
This class represents a context that runs a specified behavior at a specified frame-rate.
  • Constructor Details

    • Context

      public Context(ContextTime contextTime, AbstractBehavior abstractBehavior, String name)
      Constructs a new Context object.
      Parameters:
      contextTime - The context time object.
      abstractBehavior - The behavior to be run.
      name - The name of the thread.
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
    • thread

      public Thread thread()
      Returns the thread that is running this context.
      Returns:
      The thread object.
    • contextTime

      public ContextTime contextTime()
      This function returns the context time.
      Returns:
      The contextTime object.
    • running

      public AtomicBoolean running()
      This function returns the value of the running variable.
      Returns:
      The value of the running variable.
    • abstractBehavior

      public AbstractBehavior abstractBehavior()
      Returns the abstract behavior associated with this context.
      Returns:
      The abstract behavior.