Class Area.Rectangular
- java.lang.Object
-
- com.runemate.game.api.hybrid.location.Area
-
- com.runemate.game.api.hybrid.location.Area.Rectangular
-
- All Implemented Interfaces:
Interactable
,Locatable
,Renderable
,java.io.Serializable
- Enclosing class:
- Area
public static class Area.Rectangular extends Area
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.runemate.game.api.hybrid.location.Area
Area.Absolute, Area.Circular, Area.Polygonal, Area.Rectangular
-
-
Constructor Summary
Constructors Constructor Description Rectangular(Coordinate position)
Generates an area containing a single coordinateRectangular(Coordinate bottomLeft, Coordinate topRight)
Constructs a rectangular Area from the bottom left and top right coordinates
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
contains(Locatable locatable, boolean ignorePlane)
Area.Rectangular
derive(int x, int y, int plane)
boolean
equals(java.lang.Object obj)
Coordinate
getBottomLeft()
Coordinate
getBottomRight()
@NonNull Coordinate
getCenter()
java.util.List<Coordinate>
getCoordinates()
Gets a list of all coordinates within the areaint
getHeight()
Coordinate
getRandomCoordinate()
java.util.List<Coordinate>
getSurrounding()
Deprecated.java.util.List<Coordinate>
getSurroundingCoordinates()
Coordinate
getTopLeft()
Coordinate
getTopRight()
int
getWidth()
Area.Rectangular
grow(int horizontal, int vertical)
int
hashCode()
Area.Rectangular
toRectangular()
Converts an Area into a Area.Rectangular that contains the entire Areajava.lang.String
toString()
-
Methods inherited from class com.runemate.game.api.hybrid.location.Area
absolute, circular, click, contains, contains, containsAllOf, containsAllOf, containsAnyOf, containsAnyOf, derive, getArea, getHighPrecisionPosition, getInteractionPoint, getOverlappingCoordinates, getOverlappingCoordinates, getPosition, getVisibility, hasDynamicBounds, hover, interact, interact, interact, interact, isLoaded, isReachable, isVisible, overlaps, overlaps, polygonal, rectangular, render, render, singular
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.details.Interactable
getInteractionPoint, interact, interact, isHovered
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.details.Locatable
distanceTo, distanceTo, getLocalPosition
-
-
-
-
Constructor Detail
-
Rectangular
public Rectangular(Coordinate position)
Generates an area containing a single coordinate
-
Rectangular
public Rectangular(Coordinate bottomLeft, Coordinate topRight)
Constructs a rectangular Area from the bottom left and top right coordinates- Parameters:
bottomLeft
- The bottom left coordinate of the Area (Inclusive)topRight
- The top right coordinate of the Area (Inclusive)
-
-
Method Detail
-
derive
public Area.Rectangular derive(int x, int y, int plane)
-
grow
@NonNull public Area.Rectangular grow(int horizontal, int vertical)
- Parameters:
horizontal
- the amount to grow horizontally on each side on the x axisvertical
- the amount to grow vertically on each side on the y axis- Returns:
- an enlarged (or shrunk if negative values are used) Area.Rectangular
-
getBottomLeft
public Coordinate getBottomLeft()
-
getBottomRight
public Coordinate getBottomRight()
-
getHeight
public int getHeight()
-
getCoordinates
public java.util.List<Coordinate> getCoordinates()
Description copied from class:Area
Gets a list of all coordinates within the area- Specified by:
getCoordinates
in classArea
-
getSurrounding
@Deprecated public java.util.List<Coordinate> getSurrounding()
Deprecated.Get the coordinates surrounding this rectangular area
-
getRandomCoordinate
public Coordinate getRandomCoordinate()
- Overrides:
getRandomCoordinate
in classArea
-
getSurroundingCoordinates
public java.util.List<Coordinate> getSurroundingCoordinates()
-
getTopLeft
public Coordinate getTopLeft()
-
getTopRight
public Coordinate getTopRight()
-
toRectangular
public Area.Rectangular toRectangular()
Description copied from class:Area
Converts an Area into a Area.Rectangular that contains the entire Area- Specified by:
toRectangular
in classArea
-
getWidth
public int getWidth()
-
contains
public boolean contains(Locatable locatable, boolean ignorePlane)
-
getCenter
@NonNull public @NonNull Coordinate getCenter()
-
-