Class Base
java.lang.Object
gaiasky.scene.component.Base
- All Implemented Interfaces:
com.badlogic.ashley.core.Component, ICopy
-
Field Summary
FieldsModifier and TypeFieldDescriptionReference to the archetype used to create this entity, if any.Extra attributes.booleanFlag indicating whether the object has been computed in this step.booleanIs this just a copy?Component types, for managing visibilitylongThe internal identifierbooleanHas this been updated at least once?longTime of last visibility change in millisecondsintThe index of the localized name in thenamesarray.String[]The name(s) of the node, if any.floatThe ownOpacity value (alpha)booleanIs this node visible? -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExtraAttribute(String name, Object value) intAdds a name to the list of names.com.badlogic.ashley.core.ComponentgetCopy(com.badlogic.ashley.core.Engine engine) getName()floatGets the visibility opacity factor for this base component.booleanbooleanbooleanbooleanbooleanbooleanmatchesName(String candidate, boolean matchCase) Checks if the entity holding thisBasecomponent has a name that matches the candidate.longComputes the elapsed number of milliseconds since the last visibility state change for the given base component.voidsetAltname(String altname) voidsetAltName(String altname) voidvoidvoidsetComponentType(String[] cts) voidsetComponentTypes(String[] cts) voidvoidvoidvoidSets the given index in the names list to the given name.voidvoid
-
Field Details
-
archetype
Reference to the archetype used to create this entity, if any. -
id
public long idThe internal identifier -
names
The name(s) of the node, if any. -
localizedNameIndex
public int localizedNameIndexThe index of the localized name in thenamesarray. -
lastStateChangeTimeMs
public long lastStateChangeTimeMsTime of last visibility change in milliseconds -
opacity
public float opacityThe ownOpacity value (alpha) -
ct
Component types, for managing visibility -
computed
public boolean computedFlag indicating whether the object has been computed in this step. -
visible
public boolean visibleIs this node visible? -
copy
public boolean copyIs this just a copy? -
initialUpdate
public boolean initialUpdateHas this been updated at least once? -
attributes
-
-
Constructor Details
-
Base
public Base()
-
-
Method Details
-
getName
-
setName
-
setNames
-
setName
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
-
hasName
-
matchesName
Checks if the entity holding thisBasecomponent has a name that matches the candidate. If the candidate string is not a regex, the matching is done with equals() and contains(). If the candidate string is a regex- Parameters:
candidate- The candidate string.matchCase- Whether to match the case.- Returns:
- True if the entity has a name matching the candidate. False otherwise.
-
addName
Adds a name to the list of names.- Parameters:
name- The name.- Returns:
- The index of the added name.
-
getLocalizedName
-
updateLocalizedName
public void updateLocalizedName() -
setAltname
-
setAltName
-
hasCt
-
setComponentType
-
setCt
-
setComponentTypes
-
setComponentType
-
setCt
-
setComponentType
-
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.
-
addExtraAttribute
-
getExtraAttributes
-
hasExtraAttributes
public boolean hasExtraAttributes() -
getCopy
-