Package dev.prozilla.pine.core.component
Class Component
java.lang.Object
dev.prozilla.pine.core.component.Component
- All Implemented Interfaces:
Destructible,Printable,ApplicationContext,ApplicationProvider,ComponentsContext,ComponentsProvider,EntityContext,EntityProvider,SceneContext,SceneProvider
- Direct Known Subclasses:
AnimationData,AudioEffectPlayer,AudioPlayer,BorderImage,ButtonNode,CameraControlData,CameraData,DevConsoleData,DynamicText,FrameNode,GridGroup,ImageNode,LayoutNode,MultiTileRenderer,Node,NodeRoot,NodeStyleBase,ParticleEmitter,ParticleRenderer,RectRenderer,SpriteRenderer,TextInputNode,TextNode,TileRenderer,TooltipNode,Transform
public abstract class Component
extends Object
implements Printable, Destructible, EntityProvider, ComponentsProvider, ApplicationProvider, SceneProvider
Contains a partition of the data of an entity.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Removes this component from its entity.booleanGetter for the entity this component is attached to.getName()getScene()inthashCode()protected voidonEntityChange(Entity oldEntity, Entity newEntity) voidsetActive(boolean active) Enables or disables this component.void@NotNull StringtoString()Returns a string representation of this object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.prozilla.pine.core.ApplicationProvider
getAudioDevice, getConfig, getInput, getLocalStorage, getLogger, getModManager, getRenderer, getTimer, getTracker, getWindowMethods inherited from interface dev.prozilla.pine.core.component.ComponentsProvider
getComponent, getComponentInParent, getComponentInParent, getComponents, getComponentsInChildrenMethods inherited from interface dev.prozilla.pine.core.entity.EntityContext
isDescendantOfMethods inherited from interface dev.prozilla.pine.core.entity.EntityProvider
getChild, getChildWithTag, getFirstChild, getLastChild, getParentWithTag, getTransform, isDescendantOfMethods 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.- Specified by:
destroyin interfaceDestructible
-
setEntity
-
onEntityChange
-
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:
getEntityin interfaceComponentsProvider- Specified by:
getEntityin interfaceEntityProvider- Returns:
- Entity
-
getApplication
- Specified by:
getApplicationin interfaceApplicationProvider
-
getScene
- Specified by:
getScenein interfaceSceneProvider
-
getName
-
hashCode
public int hashCode() -
equals
-
toString
Description copied from interface:PrintableReturns a string representation of this object.
-