Class Base

java.lang.Object
gaiasky.scene.component.Base
All Implemented Interfaces:
com.badlogic.ashley.core.Component, ICopy

public class Base extends Object implements com.badlogic.ashley.core.Component, ICopy
  • Field Details

    • archetype

      public Archetype archetype
      Reference to the archetype used to create this entity, if any.
    • id

      public long id
      The internal identifier
    • names

      public String[] names
      The name(s) of the node, if any.
    • localizedNameIndex

      public int localizedNameIndex
      The index of the localized name in the names array.
    • lastStateChangeTimeMs

      public long lastStateChangeTimeMs
      Time of last visibility change in milliseconds
    • opacity

      public float opacity
      The ownOpacity value (alpha)
    • ct

      public ComponentTypes ct
      Component types, for managing visibility
    • computed

      public boolean computed
      Flag indicating whether the object has been computed in this step.
    • visible

      public boolean visible
      Is this node visible?
    • forceLabel

      public boolean forceLabel
      Force to render the label of this entity, bypassing the solid angle check
    • copy

      public boolean copy
      Is this just a copy?
    • initialUpdate

      public boolean initialUpdate
      Has this been updated at least once?
  • Constructor Details

    • Base

      public Base()
  • Method Details

    • getName

      public String getName()
    • setName

      public void setName(String name)
    • setNames

      public void setNames(String[] names)
    • setName

      public void setName(String name, int index)
      Sets the given index in the names list to the given name. If the index is out of bounds, nothing happens.
      Parameters:
      name - The new name.
      index - The index in the names list.
    • hasName

      public boolean hasName(String candidate)
    • hasName

      public boolean hasName(String candidate, boolean matchCase)
    • addName

      public int addName(String name)
      Adds a name to the list of names.
      Parameters:
      name - The name.
      Returns:
      The index of the added name.
    • getLocalizedName

      public String getLocalizedName()
    • updateLocalizedName

      public void updateLocalizedName()
    • setAltname

      public void setAltname(String altname)
    • setAltName

      public void setAltName(String altname)
    • hasCt

      public boolean hasCt(ComponentTypes.ComponentType ct)
    • setCt

      public void setCt(String ct)
    • setCt

      public void setCt(String[] cts)
    • setComponentType

      public void setComponentType(ComponentTypes.ComponentType ct)
    • isVisible

      public boolean isVisible()
    • msSinceStateChange

      public long msSinceStateChange()
      Computes the elapsed number of milliseconds since the last visibility state change for the given base component.
      Returns:
      The elapsed time [ms] since the last visibility state change.
    • getVisibilityOpacityFactor

      public float getVisibilityOpacityFactor()
      Gets the visibility opacity factor for this base component.
      Returns:
      The visibility opacity factor.
    • getCopy

      public com.badlogic.ashley.core.Component getCopy(com.badlogic.ashley.core.Engine engine)
      Specified by:
      getCopy in interface ICopy