Interface Archetype<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>

  • All Superinterfaces:
    Attributes, BaseObject<G,​A,​R,​R>, java.lang.Cloneable, java.lang.Iterable<G>, java.io.Serializable
    All Known Subinterfaces:
    Archetype, Archetype, Archetype
    All Known Implementing Classes:
    AbstractArchetype, DefaultArchetype, DefaultArchetype, DefaultArchetype, UndefinedArchetype, UndefinedArchetype, UndefinedArchetype

    public interface Archetype<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>
    extends BaseObject<G,​A,​R,​R>
    Reflects an Archetype. This interface is part of extracting the Archetype functionality from GameObject into a class of its own. The plan is to let GameObject implement this interface and change the type of getArchetype() and other Archetype related methods from GameObject to Archetype and see what breaks. Then all method signatures are copied to this interface. Once that is done we technically know what an Archetype is and can create a class for it. Once the Archetype classes are finished, GameObject will no longer implement Archetype and we've separated Archetype from GameObject.
    • Method Detail

      • iterator

        @NotNull
        @NotNull java.util.Iterator<G> iterator()
        Returns all inventory objects.
        Specified by:
        iterator in interface java.lang.Iterable<G extends GameObject<G,​A,​R>>
        Returns:
        an iterator returning all inventory objects
      • addLast

        void addLast​(@NotNull
                     G gameObject)
        Adds the given GameObject at the end of this Container.
        Parameters:
        gameObject - the free yet unlinked GameObject to be placed in the inventory
        Throws:
        java.lang.IllegalArgumentException - if gameObject already is inside another container
      • addFirst

        void addFirst​(@NotNull
                      G gameObject)
        Adds the given GameObject at the beginning of this Container.
        Parameters:
        gameObject - the free yet unlinked GameObject to be placed in the inventory
        Throws:
        java.lang.IllegalArgumentException - if gameObject already is inside another container
      • getArchetypeName

        @NotNull
        @NotNull java.lang.String getArchetypeName()
        Returns the name of this archetype.
        Returns:
        the name
      • setArchetypeName

        void setArchetypeName​(@NotNull
                              @NotNull java.lang.String archetypeName)
        Sets the name of this archetype.
        Parameters:
        archetypeName - the name
      • isUndefinedArchetype

        boolean isUndefinedArchetype()
        Return whether this archetype denotes an undefined archetype.
        Returns:
        true if this archetype denotes an undefined archetype
      • setMultiX

        void setMultiX​(int multiX)
        Sets the x-position of this part of a multi-part object. The x-position is relative to the head part.
        Parameters:
        multiX - the x-distance of this part to the head part
      • setMultiY

        void setMultiY​(int multiY)
        Sets the y-position of this part of a multi-part object. The y-position is relative to the head part.
        Parameters:
        multiY - the y-distance of this part to the head part
      • getMultiX

        int getMultiX()
        Returns the x-distance of this part to the head part. For single-part objects this is always zero.
        Returns:
        the x-distance of this part to the head part
      • getMultiY

        int getMultiY()
        Returns the y-distance of this part to the head part. For single-part objects this is always zero.
        Returns:
        the y-distance of this part to the head part
      • isLowestPart

        boolean isLowestPart()
        Returns whether this part has the smallest y coordinate when painting the image.
        Returns:
        whether this part has the smallest y coordinate
      • setLowestPart

        void setLowestPart​(boolean isLowestPart)
        Sets whether this part has the smallest y coordinate when painting the image.
        Parameters:
        isLowestPart - whether this part has the smallest y coordinate
      • getMultiShapeID

        int getMultiShapeID()
        Returns the multi shape id.
        Returns:
        the multi shape id
      • setMultiShapeID

        void setMultiShapeID​(int multiShapeID)
        Sets the multi shape id.
        Parameters:
        multiShapeID - the multi shape id
      • getMultiPartNr

        int getMultiPartNr()
        Returns the multi part id.
        Returns:
        the multi part id
      • setMultiPartNr

        void setMultiPartNr​(int multiPartNr)
        Sets the multi part id.
        Parameters:
        multiPartNr - the multi part id
      • getEditorFolder

        @Nullable
        @Nullable java.lang.String getEditorFolder()
        Returns the editor folder.
        Returns:
        the editor folder
      • setEditorFolder

        void setEditorFolder​(@Nullable
                             @Nullable java.lang.String editorFolder)
        Set the editor folder.
        Parameters:
        editorFolder - the editor folder
      • isArtifact

        boolean isArtifact()
        Returns whether this GameObject is an Artifact. Artifacts are special forms of Archetypes, and they are excluded from Archetypes collection.
        Returns:
        true if this GameObject is an Artifact, otherwise false.
      • setArtifact

        void setArtifact()
        Converts this game object into an artifact.
        See Also:
        isArtifact()
      • getAttributeKeys

        @NotNull
        @NotNull java.util.Collection<java.lang.String> getAttributeKeys()
        Returns all attribute keys of this archetype.
        Returns:
        the attribute keys