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 Details

    • id

      public final int id
    • isActive

      public boolean isActive
    • entity

      public Entity 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:
      destroy in interface Lifecycle
    • setActive

      public void setActive(boolean active)
      Enables or disables this component.
      Parameters:
      active - True enables this component, false disables it.
    • getEntity

      public Entity getEntity()
      Getter for the entity this component is attached to.
      Specified by:
      getEntity in interface ComponentsProvider
      Specified by:
      getEntity in interface EntityProvider
      Returns:
      Entity
    • getApplication

      public Application getApplication()
      Specified by:
      getApplication in interface ApplicationProvider
    • getScene

      public Scene getScene()
      Specified by:
      getScene in interface SceneProvider
    • getName

      public String getName()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Component component)
    • toString

      public String toString()
      Description copied from interface: Printable
      Returns a string representation of this object.
      Specified by:
      toString in interface Printable
      Overrides:
      toString in class Object
      Returns:
      String representation of this object.