java.lang.Object
net.botwithus.rs3.game.scene.entities.Entity
net.botwithus.rs3.game.scene.entities.item.GroundItem
- All Implemented Interfaces:
Identifiable
,Interactable<GroundItemAction>
,Onymous
,Validatable
,Locatable
-
Nested Class Summary
Nested classes/interfaces inherited from class net.botwithus.rs3.game.scene.entities.Entity
Entity.Type
-
Field Summary
-
Constructor Summary
ConstructorDescriptionGroundItem
(int id, Coordinate coordinate, int stackSize, ScenePosition scene) -
Method Summary
Modifier and TypeMethodDescriptionboolean
@Nullable ItemType
@Nullable String
getName()
Gets the options available for this Interactableint
int
hashCode()
boolean
boolean
interact
(String option, BiFunction<String, CharSequence, Boolean> spred, Function<Integer, GroundItemAction> typeMapper) Executes an action based on the given option.boolean
interact
(GroundItemAction type) Performs an action based on the given type.boolean
validate()
Gets whether the object is valid There can be many reasons aValidatable
may not be valid.Methods inherited from class net.botwithus.rs3.game.scene.entities.Entity
getArea, getCoordinate, getId, getScene, getType
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.botwithus.rs3.game.annotations.Interactable
getDefaultMapper, interact, interact
Methods inherited from interface net.botwithus.rs3.game.Locatable
distanceTo, isReachable
-
Constructor Details
-
GroundItem
-
-
Method Details
-
getStackSize
public int getStackSize() -
getConfigType
-
getName
-
interact
- Specified by:
interact
in interfaceInteractable<GroundItemAction>
-
interact
public boolean interact(String option, BiFunction<String, CharSequence, Boolean> spred, Function<Integer, GroundItemAction> typeMapper) Description copied from interface:Interactable
Executes an action based on the given option.- Specified by:
interact
in interfaceInteractable<GroundItemAction>
- Parameters:
option
- the option to be checkedspred
- a BiFunction that takes a String and a CharSequence and returns a booleantypeMapper
- a Function that takes an Integer and returns a generic type- Returns:
- a boolean indicating whether the action was successful
-
getOptions
Description copied from interface:Interactable
Gets the options available for this Interactable- Specified by:
getOptions
in interfaceInteractable<GroundItemAction>
- Returns:
- a list of strings containing the options
-
equals
-
hashCode
public int hashCode() -
validate
public boolean validate()Description copied from interface:Validatable
Gets whether the object is valid There can be many reasons aValidatable
may not be valid. These can range from the entity has despawned, a component has closed, a coordinate is no longer in the scene, an animation sequence has ended, and many other reasons..- Specified by:
validate
in interfaceValidatable
- Returns:
- true if the object passes validation, otherwise false
-