PlayerMovementUseCase
scalata.application.usecases.playerusecases.PlayerMovementUseCase
class PlayerMovementUseCase extends CreatureUseCase[GameResult[GameSession], Direction]
Handles a single movement command issued by the player.
==== Decision tree ====
-
Simple step – if the target tile lies inside the current room and is free of living enemies/items, update the player’s position.
-
Door transition – when the tile matches the current door and the room contains an exit in that direction, move the player to the neighbouring room, advance
GameState.currentRoomand push any enemy standing on the entrance one tile inward. -
Invalid – in all other cases return
GameError.InvalidInput.
Attributes
- Graph
-
- Supertypes
Members list
In this article