|
5 | 5 | import io.luna.game.model.mob.InteractionTask; |
6 | 6 |
|
7 | 7 | /** |
8 | | - * Represents an {@link Event} type that needs to be posted within an {@link InteractionTask}. Events like this are |
9 | | - * not posted until the interaction can be successfully completed. |
| 8 | + * Represents an {@link Event} type that require a target to be interacted with, before they are posted. |
| 9 | + * <p> |
| 10 | + * Events implementing this interface are not dispatched immediately. Instead, they are wrapped in an |
| 11 | + * {@link InteractionTask}, which handles movement and distance checks. The event is only posted once the |
| 12 | + * interaction requirements (such as proximity) are successfully satisfied. |
| 13 | + * <p> |
| 14 | + * Typical use cases include: |
| 15 | + * <ul> |
| 16 | + * <li>Clicking an NPC that requires walking to it first.</li> |
| 17 | + * <li>Interacting with an object that must be reached.</li> |
| 18 | + * <li>Casting a spell on an entity.</li> |
| 19 | + * </ul> |
10 | 20 | * |
11 | 21 | * @author lare96 |
12 | 22 | */ |
13 | 23 | public interface InteractableEvent { |
14 | 24 |
|
15 | 25 | /** |
16 | | - * @return The target of this interactable event. |
| 26 | + * Returns the interaction target for this event. |
| 27 | + * <p> |
| 28 | + * The returned {@link Entity} is used by the {@link InteractionTask} to determine pathfinding, proximity checks, |
| 29 | + * and completion conditions. |
| 30 | + * |
| 31 | + * @return The target entity of the interaction. |
17 | 32 | */ |
18 | 33 | Entity target(); |
19 | 34 |
|
20 | 35 | /** |
21 | | - * The interaction distance. |
| 36 | + * Returns the required interaction distance. |
| 37 | + * <p> |
| 38 | + * This represents the maximum allowed tile distance between the actor and the {@link #target()} before the |
| 39 | + * interaction is considered valid. |
| 40 | + * <p> |
| 41 | + * The default value is {@code 1}, meaning the actor must stand adjacent to the target. |
| 42 | + * |
| 43 | + * @return The required interaction distance. |
22 | 44 | */ |
23 | 45 | default int distance() { |
24 | 46 | return 1; |
|
0 commit comments