Class StructureDefinition<T>

    • Method Detail

      • getElements

        public java.util.Map<java.lang.Character,​IStructureElement<T>> getElements()
      • getShapes

        public java.util.Map<java.lang.String,​java.lang.String> getShapes()
      • getStructures

        public java.util.Map<java.lang.String,​IStructureElement<T>[]> getStructures()
      • getStructureFor

        public IStructureElement<T>[] getStructureFor​(java.lang.String name)
        Description copied from interface: IStructureDefinition
        Used internally

        Might, but is not required, to throw NoSuchElementException if the given structure piece is not found.

        Specified by:
        getStructureFor in interface IStructureDefinition<T>
        Parameters:
        name - same name as for other methods here
        Returns:
        the array of elements to process
      • getControllerPosition

        public com.gtnewhorizon.structurelib.coords.Position<com.gtnewhorizon.structurelib.coords.StructureDefinitionCoords> getControllerPosition​(java.lang.String piece)
        Description copied from interface: IStructureDefinition
        Gets the controller position for a piece. Controller positions are denoted by a tilde.
        Specified by:
        getControllerPosition in interface IStructureDefinition<T>
        Parameters:
        piece - The piece name
        Returns:
        The controller position, or null if it doesn't exist for the given piece
      • getCoordinateSystem

        public com.gtnewhorizon.structurelib.coords.StructureDefinitionCoords getCoordinateSystem​(java.lang.String piece)
        Description copied from interface: IStructureDefinition
        Gets the coordinate system for a piece. This is used to translate structure definition coordinates into structure relative coordinates.
        Specified by:
        getCoordinateSystem in interface IStructureDefinition<T>
        Parameters:
        piece - The piece
        Returns:
        The coordinate system
      • getAllSockets

        @Nonnull
        public java.util.List<com.gtnewhorizon.structurelib.coords.Position<com.gtnewhorizon.structurelib.coords.StructureDefinitionCoords>> getAllSockets​(java.lang.String piece,
                                                                                                                                                           char socket)
        Description copied from interface: IStructureDefinition
        Gets all sockets with a given character for a piece.
        Specified by:
        getAllSockets in interface IStructureDefinition<T>
        Parameters:
        piece - The piece name
        socket - The socket character
        Returns:
        The list of socket positions, or an empty list if the socket is not present
        See Also:
        StructureDefinition.Builder.addSocket(char, char)