Package com.epicbot.api.shared.model
Class Area
java.lang.Object
com.epicbot.api.shared.model.Area
-
Constructor Summary
ConstructorsConstructorDescriptionArea(int swX, int swY, int neX, int neY) Creates a ground-level (plane = 0) rectangular area from x,y pairs representing south-west and north-east corners.Area(int plane, int swX, int swY, int neX, int neY) Creates a rectangular area from x,y pairs representing south-west and north-east corners.Creates a polygonal area from the given locatables.Creates a rectangular area from south-west and north-east locatables.Creates polygonal area from the given locatables.Creates a rectangular area (plane = center.getPlane()) with a radius around the given center.Creates a rectangular area from south-west and north-east locatables. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int x, int y) Appends a point to this area.voidAppends a locatable to this area.booleancontains(int x, int y) Determines if the x,y pair is contained in this area.booleancontains(int plane, int x, int y) Determines if the x,y pair is contained in this area.booleanDetermines if at least one of the given locatables is contained in this area.booleanDetermines if at least one of the given locatables is contained in this area.booleancontainsAll(int plane, Locatable... locatables) Determines if every given locatable is contained in this area.booleancontainsAll(Locatable... locatables) Determines if every given locatable is contained in this area.voiddraw(PaintContext paintContext) voiddraw(PaintContext paintContext, Color color) Gets the averaged center tile of this area.intgetNearestTile(APIContext ctx) Finds the nearest tile in this area to the local player.getNearestTile(Tile base, APIContext ctx) Finds the nearest tile in this area to the base tile.intgetPlane()Gets a random tile within this area.Tile[]Tile[]getTiles()intgetWidth()intgetX()intgetY()
-
Constructor Details
-
Area
public Area(int swX, int swY, int neX, int neY) Creates a ground-level (plane = 0) rectangular area from x,y pairs representing south-west and north-east corners.- Parameters:
swX- the x coordinate of the south-west corner, or the left side.swY- the y coordinate of the south-west corner, or the bottom side.neX- the x coordinate of the north-east corner, or the right side.neY- the y coordinate of the north-east corner, or the top side.
-
Area
public Area(int plane, int swX, int swY, int neX, int neY) Creates a rectangular area from x,y pairs representing south-west and north-east corners.- Parameters:
plane- the z-plane of this area.swX- the x coordinate of the south-west corner, or the left side.swY- the y coordinate of the south-west corner, or the bottom side.neX- the x coordinate of the north-east corner, or the right side.neY- the y coordinate of the north-east corner, or the top side.
-
Method Details
-
add
public void add(int x, int y) Appends a point to this area.- Parameters:
x- the x coordinate.y- the y coordinate.
-
contains
public boolean contains(int x, int y) Determines if the x,y pair is contained in this area.- Parameters:
x- the x coordinate.y- the y coordinate.- Returns:
- whether the given x,y pair exists inside this area.
-
contains
public boolean contains(int plane, int x, int y) Determines if the x,y pair is contained in this area.- Parameters:
plane- the z-plane to test on, can be -1x- the x coordinate.y- the y coordinate.- Returns:
- whether the given x,y pair exists inside this area on the given plane.
-
getCentralTile
Gets the averaged center tile of this area.- Returns:
Tile
-
getRandomTile
Gets a random tile within this area.- Returns:
Tile
-
getHeight
public int getHeight()- Returns:
- the difference between the two vertical maximums of this area.
-
getBounds
- Returns:
- a Rectangle which completely envelops this area.
-
getTiles
- Returns:
- an array of all the contained tiles in this area.
-
getPlane
public int getPlane()- Returns:
- the plane of this area.
-
getTileArray
- Returns:
- an array of the bounding tiles used to make the area.
-
getWidth
public int getWidth()- Returns:
- the difference between the two horizontal maximums of this area.
-
getX
public int getX()- Returns:
- the left most side of this area.
-
getY
public int getY()- Returns:
- the top most side of this area.