Package dev.prozilla.pine.core.component
Class Component
java.lang.Object
dev.prozilla.pine.core.component.Component
- All Implemented Interfaces:
Lifecycle
,Printable
,ApplicationContext
,ApplicationProvider
,ComponentsContext
,ComponentsProvider
,EntityContext
,EntityProvider
,SceneContext
,SceneProvider
- Direct Known Subclasses:
AnimationData
,BorderImage
,ButtonNode
,CameraControlData
,CameraData
,DynamicText
,FrameNode
,GridGroup
,ImageNode
,LayoutNode
,MultiTileRenderer
,Node
,NodeRoot
,NodeStyleBase
,ParticleEmitter
,ParticleRenderer
,SpriteRenderer
,TextNode
,TileRenderer
,TooltipNode
,Transform
public abstract class Component
extends Object
implements Lifecycle, Printable, EntityProvider, ComponentsProvider, ApplicationProvider, SceneProvider
Contains a partition of the data of an entity.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Removes this component from its entity.boolean
Getter for the entity this component is attached to.getName()
getScene()
int
hashCode()
void
setActive
(boolean active) Enables or disables this component.toString()
Returns a string representation of this object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface dev.prozilla.pine.core.ApplicationProvider
getConfig, getInput, getLogger, getModManager, getRenderer, getTimer, getTracker, getWindow
Methods inherited from interface dev.prozilla.pine.core.component.ComponentsProvider
getComponent, getComponentInParent, getComponentInParent, getComponents, getComponentsInChildren
Methods inherited from interface dev.prozilla.pine.core.entity.EntityContext
isDescendantOf
Methods inherited from interface dev.prozilla.pine.core.entity.EntityProvider
getChildWithTag, getFirstChild, getLastChild, getParentWithTag, getTransform, isDescendantOf
Methods inherited from interface dev.prozilla.pine.common.Lifecycle
init, init, input, input, render, render, update, update
Methods inherited from interface dev.prozilla.pine.core.scene.SceneProvider
getCameraData, getWorld
-
Field Details
-
id
public final int id -
isActive
public boolean isActive -
entity
The entity that this component is attached to.
-
-
Constructor Details
-
Component
public Component()
-
-
Method Details
-
destroy
public void destroy()Removes this component from its entity. -
setActive
public void setActive(boolean active) Enables or disables this component.- Parameters:
active
- True enables this component, false disables it.
-
getEntity
Getter for the entity this component is attached to.- Specified by:
getEntity
in interfaceComponentsProvider
- Specified by:
getEntity
in interfaceEntityProvider
- Returns:
- Entity
-
getApplication
- Specified by:
getApplication
in interfaceApplicationProvider
-
getScene
- Specified by:
getScene
in interfaceSceneProvider
-
getName
-
hashCode
public int hashCode() -
equals
-
toString
Description copied from interface:Printable
Returns a string representation of this object.
-