Package com.xebisco.yield
Class SystemBehavior
java.lang.Object
com.xebisco.yield.AbstractBehavior
com.xebisco.yield.SystemBehavior
- All Implemented Interfaces:
Behavior,Closeable,AutoCloseable
- Direct Known Subclasses:
PhysicsSystem
An abstract class representing a system. It contains methods for managing scenes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidonStart()This method is called when the behavior is started.voidonUpdate(ContextTime time) This method is called when the behavior needs to be updated with the current time.scene()Returns the current scene reference.This function sets the scene for thisSystemBehavior.Methods inherited from class com.xebisco.yield.AbstractBehavior
frames, tick
-
Constructor Details
-
SystemBehavior
public SystemBehavior()
-
-
Method Details
-
onStart
public void onStart()Description copied from interface:BehaviorThis method is called when the behavior is started. It is typically used to initialize any necessary state or resources. -
onUpdate
Description copied from interface:BehaviorThis 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
- Throws:
IOException
-
scene
Returns the current scene reference.- Returns:
- The current scene reference.
-
setScene
This function sets the scene for thisSystemBehavior. It does not change the application's scene, to change the scene, use theApplication.setScene(com.xebisco.yield.Scene)method.- Parameters:
scene- The scene reference to be set.- Returns:
- The current instance of SystemBehavior for method chaining.
-