PlayerInventoryUseCase
scalata.application.usecases.playerusecases.PlayerInventoryUseCase
class PlayerInventoryUseCase extends CreatureUseCase[GameResult[GameSession], String]
Handles the “use item” command.
- Looks up the item by
itemNamein the player’s inventory. - Delegates to the
Usabletype-class to apply the effect (Potion, Weapon, Dust, …). - Updates the player inside the
Worldand returns aGameResult.successwrapping the newGameSession. - If the player does not own the item, returns
GameResult.Error(GameError.ItemNotOwned).
Attributes
- Graph
-
- Supertypes
Members list
In this article