Package ecs
Class Component
java.lang.Object
ecs.Component
- All Implemented Interfaces:
Comparable<Component>
- Direct Known Subclasses:
CharacterController
,CollisionHandler
,Dynamics
,PointLight
,PolygonCollider
,SpriteAnimation
,SpriteRenderer
Azurite
Abstract structure for ECS Components. It is highly recommended to use this when implementing any system that can/should be applied to a GameObject.-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
debug()
Get an array of debug lines to be rendered in debug modeprotected org.joml.Vector2f
position()
Shortcut to get the current position of the parent gameobject.void
remove()
Called when component is removed from GameObject.protected void
setPosition
(org.joml.Vector2f position) Shortcut to overwrite the current position of the parent gameobject.void
start()
Called once on Component initialization.void
update
(float dt) Called once per frame for each Component
-
Field Details
-
gameObject
Parent GameObject
-
-
Constructor Details
-
Component
-
Component
public Component()
-
-
Method Details
-
start
public void start()Called once on Component initialization. -
update
public void update(float dt) Called once per frame for each Component- Parameters:
dt
- Engine.deltaTime
-
debug
Get an array of debug lines to be rendered in debug mode- Returns:
- an array of lines to be rendered in debug mode
-
position
protected org.joml.Vector2f position()Shortcut to get the current position of the parent gameobject.- Returns:
- the current position of the parent gameobject
-
setPosition
protected void setPosition(org.joml.Vector2f position) Shortcut to overwrite the current position of the parent gameobject. -
compareTo
- Specified by:
compareTo
in interfaceComparable<Component>
-
remove
public void remove()Called when component is removed from GameObject.
-