Interface ArchetypeSet<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
-
- All Known Implementing Classes:
DefaultArchetypeSet
public interface ArchetypeSet<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>Interface that captures similarities between different ArchetypeSet implementations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddArchetype(R archetype)Adds an Archetype to this Set.voidaddArchetypeSetListener(@NotNull ArchetypeSetListener<G,A,R> listener)Registers anArchetypeSetListener.voidconnectFaces()RgetArchetype(@NotNull java.lang.String archetypeName)Returns an Archetype by its name.intgetArchetypeCount()Returns the number of Archetypes available.@NotNull java.util.Collection<R>getArchetypes()Returns a read-only collection of allArchetypes.@Nullable java.lang.StringgetImageSet()Returns the image set.RgetOrCreateArchetype(@NotNull java.lang.String archetypeName)Returns an archetype by its name.booleanisLoadedFromArchive()Returns whether the Archetypes in this ArchetypeSet were loaded from an archive.voidremoveArchetypeSetListener(@NotNull ArchetypeSetListener<G,A,R> listener)Removes anArchetypeSetListener.voidsetLoadedFromArchive(boolean loadedFromArchive)Sets whether Archetypes were loaded from an archive.
-
-
-
Method Detail
-
isLoadedFromArchive
boolean isLoadedFromArchive()
Returns whether the Archetypes in this ArchetypeSet were loaded from an archive.- Returns:
trueif loaded from an archive, otherwisefalse
-
getArchetypeCount
int getArchetypeCount()
Returns the number of Archetypes available.- Returns:
- the number of Archetypes available
-
getArchetype
@NotNull R getArchetype(@NotNull @NotNull java.lang.String archetypeName) throws UndefinedArchetypeException
Returns an Archetype by its name.- Parameters:
archetypeName- the name of the Archetype to get- Returns:
- the archetype
- Throws:
UndefinedArchetypeException- if the no such archetype exists- See Also:
for a similar method that creates undefined archetypes
-
getOrCreateArchetype
@NotNull R getOrCreateArchetype(@NotNull @NotNull java.lang.String archetypeName)
Returns an archetype by its name. If this archetype does not exist, return anArchetypewhich hasArchetype.isUndefinedArchetype()set.- Parameters:
archetypeName- the archetype name- Returns:
- the archetype
- See Also:
getArchetype(String)
-
addArchetype
void addArchetype(@NotNull R archetype) throws DuplicateArchetypeExceptionAdds an Archetype to this Set.- Parameters:
archetype- the archetype to add- Throws:
DuplicateArchetypeException- if the archetype name is not unique
-
addArchetypeSetListener
void addArchetypeSetListener(@NotNull @NotNull ArchetypeSetListener<G,A,R> listener)Registers anArchetypeSetListener.- Parameters:
listener- the listener to register
-
removeArchetypeSetListener
void removeArchetypeSetListener(@NotNull @NotNull ArchetypeSetListener<G,A,R> listener)Removes anArchetypeSetListener.- Parameters:
listener- the listener to remove
-
getArchetypes
@NotNull @NotNull java.util.Collection<R> getArchetypes()
Returns a read-only collection of allArchetypes.- Returns:
- a read-only collection of all archetypes
-
connectFaces
void connectFaces()
-
setLoadedFromArchive
void setLoadedFromArchive(boolean loadedFromArchive)
Sets whether Archetypes were loaded from an archive.- Parameters:
loadedFromArchive-truewhen loaded from archive, otherwisefalse- See Also:
isLoadedFromArchive()
-
getImageSet
@Nullable @Nullable java.lang.String getImageSet()
Returns the image set.- Returns:
- the image set or
null
-
-