Package com.kraken.api.service.tile
Class GameArea
- java.lang.Object
-
- com.kraken.api.service.tile.GameArea
-
public class GameArea extends java.lang.ObjectEncapsulates a set of tiles representing an area. Provides helper methods for checking containment, retrieval, and visualization.
-
-
Constructor Summary
Constructors Constructor Description GameArea()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(net.runelite.api.coords.WorldPoint point)Checks if the given world point is inside this area.net.runelite.api.coords.WorldPointgetRandomTile()Returns a random tile from the area.voidrender(net.runelite.api.Client client, java.awt.Graphics2D graphics, java.awt.Color color, boolean outline)Visualizes the area on the game screen.voidrenderMinimap(net.runelite.api.Client client, java.awt.Graphics2D graphics, java.awt.Color color)Renders the area on the minimap.GameAreasubtract(GameArea other)Removes the tiles of another area from this one (Difference).GameAreaunion(GameArea other)Combines this area with another (Union).
-
-
-
Method Detail
-
contains
public boolean contains(net.runelite.api.coords.WorldPoint point)
Checks if the given world point is inside this area.- Parameters:
point- The world point to check- Returns:
- true if the world point is contained within the set of tiles and false otherwise.
-
getRandomTile
public net.runelite.api.coords.WorldPoint getRandomTile()
Returns a random tile from the area.- Returns:
- A random tile within the set of tiles
-
union
public GameArea union(GameArea other)
Combines this area with another (Union).- Parameters:
other- Another game area to check the union of- Returns:
- GameArea the union tiles of the two game areas (the tiles that overlap).
-
subtract
public GameArea subtract(GameArea other)
Removes the tiles of another area from this one (Difference).- Parameters:
other- Another game area to check- Returns:
- GameArea the tiles which are not in the other game area
-
render
public void render(net.runelite.api.Client client, java.awt.Graphics2D graphics, java.awt.Color color, boolean outline)Visualizes the area on the game screen. This should be called from a RuneLite Overlay'srender()method.- Parameters:
client- an instance of the game clientgraphics- The graphics contextcolor- The fill color (alpha is handled automatically if needed, but best to pass a translucent color)outline- Whether to draw just the outline or fill the tiles
-
renderMinimap
public void renderMinimap(net.runelite.api.Client client, java.awt.Graphics2D graphics, java.awt.Color color)Renders the area on the minimap. This should be called from a RuneLite Overlay'srender()method- Parameters:
client- an instance of the game clientgraphics- The graphics contextcolor- The fill color (alpha is handled automatically if needed, but best to pass a translucent color)
-
-