PlayerInteractUseCase
scalata.application.usecases.playerusecases.PlayerInteractUseCase
class PlayerInteractUseCase extends CreatureUseCase[GameResult[GameSession], Direction]
Handles the “interact” command (pick up / open / read whatever lies on the tile immediately in front of the player).
==== Flow ====
- Compute the target coordinate by adding
direction.vectorto the player’s current position. - If an item is present, delegate to its
interact(GameSession)method and propagate the result. - If the tile is empty, return
GameResult.error(GameError.ItemNotPresent).
The method is pure: all updates are returned in a new GameSession; no in-place mutation occurs.
Attributes
- Graph
-
- Supertypes
Members list
In this article