public class ArchetypeType extends java.lang.Object implements java.lang.Iterable<ArchetypeAttributeSection>
Constructor and Description |
---|
ArchetypeType(java.lang.String typeName,
int typeNo,
java.lang.String display,
boolean map,
int[] inv,
boolean allowsAllInv,
java.lang.String description,
java.lang.String use,
ArchetypeAttributesDefinition typeAttributes)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addArchetypeAttribute(java.lang.String sectionName,
ArchetypeAttribute archetypeAttribute)
Adds an
ArchetypeAttribute to this archetype type. |
void |
addAttributeSection(ArchetypeAttributeSection newArchetypeAttributeSection)
Adds an
ArchetypeAttributeSection . |
java.lang.String |
getDescription()
Returns the description.
|
java.lang.String |
getDisplayName(Attributes baseObject)
Returns a description of this type.
|
int[] |
getInv()
Returns which archetype types allow this archetype type in their
inventories.
|
java.lang.String |
getTypeName()
Returns the type name (artificial).
|
int |
getTypeNo()
Returns the type number.
|
java.lang.String |
getUse()
Returns the usage notes.
|
boolean |
hasAttribute()
Returns whether this archetype type defines at least one archetype
attribute.
|
boolean |
hasAttributeKey(java.lang.Comparable<java.lang.String> key)
Returns whether an attribute key is defined.
|
boolean |
hasTypeAttributes()
Returns whether any type attributes are defined.
|
boolean |
isAllowsAllInv()
Returns whether this archetype type allows any inventory game objects,
regardless whether these types have "inv" specifications.
|
boolean |
isMap()
Returns whether this archetype is allowed on maps.
|
java.util.Iterator<ArchetypeAttributeSection> |
iterator() |
boolean |
matches(BaseObject<?,?,?,?> baseObject)
Checks whether a
BaseObject matches all type attributes. |
java.lang.String |
toString() |
void |
toString(java.lang.StringBuilder sb)
Appends a string representation of this instance to a
StringBuilder . |
public ArchetypeType(@NotNull java.lang.String typeName, int typeNo, @NotNull java.lang.String display, boolean map, @Nullable int[] inv, boolean allowsAllInv, @Nullable java.lang.String description, @Nullable java.lang.String use, @NotNull ArchetypeAttributesDefinition typeAttributes)
typeName
- the type name (artificial)typeNo
- the type numberdisplay
- additional description textmap
- whether this archetype type is allowed on mapsinv
- which archetype types allow this archetype type in their
inventories or null
for no restrictionsallowsAllInv
- whether this archetype type allows any inventory game
objects, whether these types have "inv" specificationsdescription
- the descriptionuse
- the usage notestypeAttributes
- the list of additional attributespublic void addAttributeSection(@NotNull ArchetypeAttributeSection newArchetypeAttributeSection)
ArchetypeAttributeSection
. If the section already exists
appends the new attributes to the existing section.newArchetypeAttributeSection
- the section to add@NotNull public java.util.Iterator<ArchetypeAttributeSection> iterator()
iterator
in interface java.lang.Iterable<ArchetypeAttributeSection>
public boolean hasAttribute()
public int getTypeNo()
@NotNull public java.lang.String getTypeName()
public boolean isMap()
@Nullable public int[] getInv()
null
for no
restrictionspublic boolean isAllowsAllInv()
@NotNull public java.lang.String getDescription()
@NotNull public java.lang.String getUse()
public boolean matches(@NotNull BaseObject<?,?,?,?> baseObject)
BaseObject
matches all type attributes.baseObject
- the base object to checkpublic boolean hasTypeAttributes()
public boolean hasAttributeKey(@NotNull java.lang.Comparable<java.lang.String> key)
key
- the attribute key@NotNull public java.lang.String toString()
toString
in class java.lang.Object
public void toString(@NotNull java.lang.StringBuilder sb)
StringBuilder
.sb
- the string builder@NotNull public java.lang.String getDisplayName(@NotNull Attributes baseObject)
baseObject
- the base object to describepublic void addArchetypeAttribute(@NotNull java.lang.String sectionName, @NotNull ArchetypeAttribute archetypeAttribute)
ArchetypeAttribute
to this archetype type.sectionName
- the name of the section to add toarchetypeAttribute
- the archetype attribute to add