Class PredefinedEntity

    • Method Detail

      • gameobject

        public static PredefinedEntity gameobject​(@NonNull
                                                  @NonNull Area area,
                                                  java.lang.String name)
      • npc

        public static PredefinedEntity npc​(@NonNull
                                           @NonNull Area location,
                                           java.lang.String name)
      • grounditem

        public static PredefinedEntity grounditem​(@NonNull
                                                  @NonNull Area location,
                                                  int id)
      • grounditem

        public static PredefinedEntity grounditem​(@NonNull
                                                  @NonNull Area location,
                                                  java.lang.String name)
      • getType

        @NonNull
        public @NonNull PredefinedEntity.Type getType()
        Gets the type of this predefined entity.
        Returns:
        the PredefinedEntity.Type of this entity.
      • getName

        @Nullable
        public java.lang.String getName()
        Gets the provided name for this entity.
        Returns:
        The name if it was provided, otherwise null.
      • getId

        public int getId()
      • getVisibility

        public double getVisibility()
        Description copied from interface: Interactable
        Returns a rough estimate of how visible this entity is as a percent (0 to 100)
        Specified by:
        getVisibility in interface Interactable
      • getPosition

        @NonNull
        public @NonNull Coordinate getPosition()
        Description copied from interface: Locatable
        The exact coordinate position of this entity on the world-graph
        Specified by:
        getPosition in interface Locatable
        Specified by:
        getPosition in interface LocatableEntity
        Returns:
        The coordinate position, or null if unavailable
      • getPosition

        @NonNull
        public @NonNull Coordinate getPosition​(Coordinate regionBase)
        Description copied from interface: LocatableEntity
        Gets the position using the region base as the coordinate to offset from. For optimization.
        Specified by:
        getPosition in interface LocatableEntity
        Parameters:
        regionBase - The Coordinate base of the loaded region
      • getArea

        @NonNull
        public Area.Rectangular getArea​(Coordinate regionBase)
        Description copied from interface: LocatableEntity
        Gets the area using the region base as the coordinate to offset from. For optimization.
        Specified by:
        getArea in interface LocatableEntity
        Parameters:
        regionBase - The Coordinate base of the loaded region
      • isVisible

        public boolean isVisible()
        Description copied from interface: Interactable
        Whether the entity is visible
        Specified by:
        isVisible in interface Interactable
        Returns:
        true if visible, and false if not visible
      • getInteractionPoint

        @Nullable
        public InteractablePoint getInteractionPoint​(java.awt.Point origin)
        Description copied from interface: Interactable
        Gets a point within the entity that can be interacted with. Takes into account the direction of movement from the origin point.
        Specified by:
        getInteractionPoint in interface Interactable
      • contains

        public boolean contains​(java.awt.Point point)
        Description copied from interface: Interactable
        Checks if the projected bounds of this entity contains the Point provided.
        Specified by:
        contains in interface Interactable
        Returns:
      • click

        public boolean click()
        Description copied from interface: Interactable
        Clicks this entity in an interactable point
        Specified by:
        click in interface Interactable
        Returns:
        true if successfully clicked
      • hover

        public boolean hover()
        Description copied from interface: Interactable
        Moves the mouse over this entity
        Specified by:
        hover in interface Interactable
        Returns:
        true if the mouse is hovering the entity
      • interact

        public boolean interact​(java.util.regex.Pattern action,
                                java.util.regex.Pattern target)
        Description copied from interface: Interactable
        Attempts to match action and target using Matcher.find() and then interacts with the appropriate menu item
        Specified by:
        interact in interface Interactable
        Parameters:
        action - The pattern to match the action with, if null it's ignored
        target - The pattern to match the target with, if null it's ignored
      • render

        public void render​(java.awt.Graphics2D g2d)
        Description copied from interface: Renderable
        Renders this entity onto the given Graphics2D, use is discouraged
        Specified by:
        render in interface Renderable
      • render

        public void render​(javafx.scene.canvas.GraphicsContext gc)
        Description copied from interface: Renderable
        Renders this entity onto the given GraphicsContext
        Specified by:
        render in interface Renderable
      • isValid

        public boolean isValid()
        Description copied from interface: Validatable
        Verifies whether this entity is valid and still exists, typically on the world-graph
        Specified by:
        isValid in interface Validatable
        Returns:
        true if it's still available, otherwise false
      • getModel

        @Nullable
        public Model getModel()
        Description copied from interface: Modeled
        Gets the polygon-based model of the entity
        Specified by:
        getModel in interface Modeled
        Returns:
        the entities model, otherwise the backup if set, if neither are available null
      • setBackupModel

        public void setBackupModel​(int[] frontBottomLeft,
                                   int[] backTopRight)
        Description copied from interface: Modeled
        Sets a backup model to be used when the model isn't available.
        Specified by:
        setBackupModel in interface Modeled
      • setBackupModel

        public void setBackupModel​(com.runemate.game.api.hybrid.util.collections.Pair<int[],​int[]> values)
        Description copied from interface: Modeled
        Sets a pair of points to be used to create a backup model when the in-game model isn't available
        Specified by:
        setBackupModel in interface Modeled
      • setForcedModel

        public void setForcedModel​(int[] frontBottomLeft,
                                   int[] backTopRight)
        Description copied from interface: Modeled
        Sets a model to be used regardless of whether the in-game model is available.
        Specified by:
        setForcedModel in interface Modeled
      • setForcedModel

        public void setForcedModel​(com.runemate.game.api.hybrid.util.collections.Pair<int[],​int[]> values)
        Description copied from interface: Modeled
        Sets a pair of points to be used to create a model regardless of whether the in-game model is available
        Specified by:
        setForcedModel in interface Modeled
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object