Class SystemBehavior

java.lang.Object
com.xebisco.yield.AbstractBehavior
com.xebisco.yield.SystemBehavior
All Implemented Interfaces:
Behavior, Closeable, AutoCloseable
Direct Known Subclasses:
PhysicsSystem

public abstract class SystemBehavior extends AbstractBehavior
An abstract class representing a system. It contains methods for managing scenes.
  • Constructor Details

    • SystemBehavior

      public SystemBehavior()
  • Method Details

    • onStart

      public void onStart()
      Description copied from interface: Behavior
      This method is called when the behavior is started. It is typically used to initialize any necessary state or resources.
    • onUpdate

      public void onUpdate(ContextTime time)
      Description copied from interface: Behavior
      This method is called when the behavior needs to be updated with the current time. It is typically used to perform any necessary calculations or updates based on the current time.
      Parameters:
      time - The current time context.
    • close

      public void close() throws IOException
      Throws:
      IOException
    • scene

      public Scene scene()
      Returns the current scene reference.
      Returns:
      The current scene reference.
    • setScene

      public SystemBehavior setScene(Scene scene)
      This function sets the scene for this SystemBehavior. It does not change the application's scene, to change the scene, use the Application.setScene(com.xebisco.yield.Scene) method.
      Parameters:
      scene - The scene reference to be set.
      Returns:
      The current instance of SystemBehavior for method chaining.