Package net.sf.gridarta.model.baseobject
Interface Attributes
-
- All Known Subinterfaces:
Archetype<G,A,R>,Archetype,Archetype,Archetype,BaseObject<G,A,R,T>,GameObject<G,A,R>
- All Known Implementing Classes:
AbstractArchetype,AbstractBaseObject,AbstractGameObject,DefaultArchetype,DefaultArchetype,DefaultArchetype,DefaultIsoGameObject,GameObject,GameObject,GameObject,UndefinedArchetype,UndefinedArchetype,UndefinedArchetype
public interface AttributesA set of key/value pairs.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description doublegetAttributeDouble(@NotNull java.lang.String attributeName)Returns an attribute value of this Archetype as double.intgetAttributeInt(@NotNull java.lang.String attributeName)Returns an attribute value of this Archetype as int.longgetAttributeLong(@NotNull java.lang.String attributeName)Returns an attribute value of this Archetype as long.@NotNull java.lang.StringgetAttributeString(@NotNull java.lang.String attributeName)Returns the requested attribute value of this GameObject asString.booleanhasAttribute(@NotNull java.lang.String attributeName)Returns whether an attribute name exists.voidremoveAttribute(@NotNull java.lang.String attributeName)Removes the String of an archetype attribute from the objectText.voidsetAttributeInt(@NotNull java.lang.String attributeName, int value)Sets an int value attribute.
-
-
-
Method Detail
-
hasAttribute
boolean hasAttribute(@NotNull @NotNull java.lang.String attributeName)Returns whether an attribute name exists.- Parameters:
attributeName- the attribute name- Returns:
- whether the attribute name exists
-
getAttributeString
@NotNull @NotNull java.lang.String getAttributeString(@NotNull @NotNull java.lang.String attributeName)Returns the requested attribute value of this GameObject asString. The attribute value is first searched in this GameObject. If the attribute value is not found and this GameObject is not an Archetype itself, the attribute value is searched in this GameObject's Archetype as well.- Parameters:
attributeName- the name of the attribute to search- Returns:
- the attribute value or an empty String ("") if no such attribute
-
getAttributeInt
int getAttributeInt(@NotNull @NotNull java.lang.String attributeName)Returns an attribute value of this Archetype as int.- Parameters:
attributeName- the name of the attribute value to return- Returns:
- the attribute value or
0(zero) if not found - See Also:
getAttributeString(String)
-
getAttributeLong
long getAttributeLong(@NotNull @NotNull java.lang.String attributeName)Returns an attribute value of this Archetype as long.- Parameters:
attributeName- the name of the attribute value to return- Returns:
- the attribute value or
0(zero) if not found - See Also:
getAttributeString(String)
-
getAttributeDouble
double getAttributeDouble(@NotNull @NotNull java.lang.String attributeName)Returns an attribute value of this Archetype as double.- Parameters:
attributeName- the name of the attribute value to return- Returns:
- the attribute value or
0.0(zero) if not found - See Also:
getAttributeString(String)
-
setAttributeInt
void setAttributeInt(@NotNull @NotNull java.lang.String attributeName, int value)Sets an int value attribute.- Parameters:
attributeName- the name of the attribute to updatevalue- the new value
-
removeAttribute
void removeAttribute(@NotNull @NotNull java.lang.String attributeName)Removes the String of an archetype attribute from the objectText.- Parameters:
attributeName- search for "attributeName <string>"
-
-