public class ArchetypeTypeSet extends java.lang.Object implements java.lang.Iterable<ArchetypeType>
ArchetypeType
instances, list, and bitmask definitions.Constructor and Description |
---|
ArchetypeTypeSet() |
Modifier and Type | Method and Description |
---|---|
void |
addArchetypeType(@NotNull ArchetypeType archetypeType)
Adds an
ArchetypeType instance. |
boolean |
addAttributeOrder(@NotNull java.lang.String attributeName)
Adds an attribute name for attribute ordering when saving.
|
void |
addBitmask(@NotNull java.lang.String attribute,
@NotNull AttributeBitmask attributeBitmask)
Adds a bitmask definition.
|
void |
addList(@NotNull java.lang.String attribute,
@NotNull ArchetypeTypeList list)
Adds a list definition.
|
@Nullable ArchetypeType |
getArchetypeType(@NotNull java.lang.String typeName)
Returns an
ArchetypeType by type name. |
@NotNull ArchetypeType |
getArchetypeTypeByBaseObject(@NotNull BaseObject<?,?,?,?> baseObject)
Returns the
ArchetypeType for the given BaseObject . |
@NotNull ArchetypeType |
getArchetypeTypeByName(@NotNull java.lang.String typeName)
Finds and returns the type-structure (
ArchetypeType ) that matches
the given 'typeName'. |
int |
getArchetypeTypeCount()
Returns the number of ArchetypeTypes in the list.
|
int |
getArchetypeTypeIndex(@NotNull ArchetypeType archetypeType)
Returns the index of an
ArchetypeType instance. |
@NotNull java.util.Comparator<java.lang.String> |
getAttributeOrderComparator()
Returns a
Comparator that sorts attributes keys by the order
defined by addAttributeOrder(String) . |
@Nullable AttributeBitmask |
getBitmask(@NotNull java.lang.String bitmaskName)
Returns a bitmask type by name.
|
@NotNull java.lang.String |
getDisplayName(@NotNull BaseObject<?,?,?,?> baseObject)
Returns a description of this type.
|
@Nullable ArchetypeTypeList |
getList(@NotNull java.lang.String listName)
Returns a list type definition.
|
boolean |
isFallbackArchetypeType(@NotNull ArchetypeType archetypeType)
Returns whether a given
ArchetypeType is the fallback archetype
type used for game objects not matching any defined archetype type. |
@NotNull java.util.Iterator<ArchetypeType> |
iterator() |
@NotNull java.lang.String |
toString() |
public void addArchetypeType(@NotNull @NotNull ArchetypeType archetypeType)
ArchetypeType
instance.archetypeType
- the archetype type instance@Nullable public @Nullable ArchetypeType getArchetypeType(@NotNull @NotNull java.lang.String typeName)
ArchetypeType
by type name.typeName
- the type name to look upnull
if the type name does
not exist@NotNull public @NotNull ArchetypeType getArchetypeTypeByName(@NotNull @NotNull java.lang.String typeName)
ArchetypeType
) that matches
the given 'typeName'. These type-names are "artificial" names, defined in
"types.xml". They appear in the type selection box in the
attribute-dialog.typeName
- the name of the type to getArchetypeType
that matches, or the default ("Misc")
type if no match is found@NotNull public @NotNull ArchetypeType getArchetypeTypeByBaseObject(@NotNull @NotNull BaseObject<?,?,?,?> baseObject)
ArchetypeType
for the given BaseObject
.baseObject
- the base object to find the archetype type for@NotNull public @NotNull java.util.Iterator<ArchetypeType> iterator()
iterator
in interface java.lang.Iterable<ArchetypeType>
public int getArchetypeTypeIndex(@NotNull @NotNull ArchetypeType archetypeType)
ArchetypeType
instance.archetypeType
- the archetype type instancepublic int getArchetypeTypeCount()
public boolean isFallbackArchetypeType(@NotNull @NotNull ArchetypeType archetypeType)
ArchetypeType
is the fallback archetype
type used for game objects not matching any defined archetype type.archetypeType
- the archetype type to checkpublic void addList(@NotNull @NotNull java.lang.String attribute, @NotNull @NotNull ArchetypeTypeList list)
attribute
- the attribute namelist
- the list definition@Nullable public @Nullable ArchetypeTypeList getList(@NotNull @NotNull java.lang.String listName)
listName
- the list namenull
if the list does not
existpublic void addBitmask(@NotNull @NotNull java.lang.String attribute, @NotNull @NotNull AttributeBitmask attributeBitmask)
attribute
- the attribute nameattributeBitmask
- the list definition@Nullable public @Nullable AttributeBitmask getBitmask(@NotNull @NotNull java.lang.String bitmaskName)
bitmaskName
- the bitmask name to look upnull
if the name does not existpublic boolean addAttributeOrder(@NotNull @NotNull java.lang.String attributeName)
attributeName
- the attribute name@NotNull public @NotNull java.util.Comparator<java.lang.String> getAttributeOrderComparator()
Comparator
that sorts attributes keys by the order
defined by addAttributeOrder(String)
.@NotNull public @NotNull java.lang.String getDisplayName(@NotNull @NotNull BaseObject<?,?,?,?> baseObject)
baseObject
- the base object to describe@NotNull public @NotNull java.lang.String toString()
toString
in class java.lang.Object