Package com.mygdx.game.Components
Class Component
java.lang.Object
com.mygdx.game.Components.Component
- Direct Known Subclasses:
AINavigation,Pirate,PlayerController,Renderable,RigidBody,Text,TileMap,Transform
public abstract class Component
extends java.lang.Object
Base class for the Components
-
Field Summary
Fields Modifier and Type Field Description protected Entityparentprotected booleanreqsMetprotected java.util.ArrayList<ComponentType>requirementsprotected ComponentTypetype -
Constructor Summary
Constructors Modifier Constructor Description protectedComponent() -
Method Summary
Modifier and Type Method Description voidawake()Called once before start prior to the update loop.voidcleanUp()Called once after the update loop has finished.EntitygetParent()ComponentTypegetType()voidrender()Called once per frame used exclusively for renderingvoidsetParent(Entity e)voidsetRequirements(ComponentType... reqs)Sets the required componentsvoidstart()Called once after awake but prior to the update loop.voidupdate()Called once per frameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
type
-
parent
-
requirements
-
reqsMet
protected boolean reqsMet
-
-
Constructor Details
-
Component
protected Component()
-
-
Method Details
-
setParent
-
getParent
-
setRequirements
Sets the required components- Parameters:
reqs- take a guess
-
getType
-
awake
public void awake()Called once before start prior to the update loop. -
start
public void start()Called once after awake but prior to the update loop. -
cleanUp
public void cleanUp()Called once after the update loop has finished. -
update
public void update()Called once per frame -
render
public void render()Called once per frame used exclusively for rendering
-