Package rs.kreme.ksbot.api.game.magic
Class RunePouch
- java.lang.Object
-
- rs.kreme.ksbot.api.game.magic.RunePouch
-
public class RunePouch extends java.lang.ObjectRepresents the player's Rune Pouch, providing utilities to check and retrieve rune types and quantities.The RunePouch allows for efficient lookup of rune contents using Guava's in-memory cache to reduce redundant varbit reads.
Includes methods for checking single and multiple rune requirements, with optional quantity checks.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRunePouch.RuneSlotEnum representing the 3 rune slots inside the Rune Pouch.
-
Constructor Summary
Constructors Constructor Description RunePouch()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Integer>getAllRunes()Retrieves a map of all runes currently stored in the pouch.intgetQuantity(Rune rune)Retrieves the quantity of a specific rune contained within the pouch.booleanhasPouch()Checks if the player currently possesses a Rune Pouch in their inventory.booleanhasRune(Rune rune)Determines if the pouch contains the specified rune.booleanhasRune(Rune rune, int amount)Determines if the pouch contains at least the specified amount of a given rune.booleanhasRunes(java.util.Collection<Rune> runes)Checks if the pouch contains all specified runes (any amount).booleanhasRunes(Rune... runes)Varargs overload ofhasRunes(Collection).booleanhasRunesWithAmount(java.util.Map<Rune,java.lang.Integer> requiredRunes)Checks if the pouch contains multiple runes with specific required quantities.
-
-
-
Method Detail
-
hasPouch
public boolean hasPouch()
Checks if the player currently possesses a Rune Pouch in their inventory.- Returns:
trueif the player has a Rune Pouch; otherwisefalse.
-
getQuantity
public int getQuantity(Rune rune)
Retrieves the quantity of a specific rune contained within the pouch.- Parameters:
rune- The rune to check.- Returns:
- The quantity of the specified rune, or 0 if not found or pouch is missing.
-
hasRune
public boolean hasRune(Rune rune)
Determines if the pouch contains the specified rune.- Parameters:
rune- The rune to check.- Returns:
trueif the rune exists in any slot; otherwisefalse.
-
hasRune
public boolean hasRune(Rune rune, int amount)
Determines if the pouch contains at least the specified amount of a given rune.- Parameters:
rune- The rune to check.amount- The required quantity.- Returns:
trueif the pouch contains enough runes; otherwisefalse.
-
hasRunes
public boolean hasRunes(java.util.Collection<Rune> runes)
Checks if the pouch contains all specified runes (any amount).- Parameters:
runes- The runes to check.- Returns:
trueif all runes are present; otherwisefalse.
-
hasRunes
public boolean hasRunes(Rune... runes)
Varargs overload ofhasRunes(Collection).- Parameters:
runes- The runes to check.- Returns:
trueif all runes are present; otherwisefalse.
-
hasRunesWithAmount
public boolean hasRunesWithAmount(java.util.Map<Rune,java.lang.Integer> requiredRunes)
Checks if the pouch contains multiple runes with specific required quantities.- Parameters:
requiredRunes- A map of rune - required quantity.- Returns:
trueif all runes meet or exceed their required amounts; otherwisefalse.
-
getAllRunes
public java.util.Map<java.lang.String,java.lang.Integer> getAllRunes()
Retrieves a map of all runes currently stored in the pouch.- Returns:
- A map of rune names - quantities. Empty if no pouch or empty slots.
-
-