Pickable

scalata.domain.entities.components.Pickable
trait Pickable

Mixin for every item that the player can pick up.

  • pick removes the item from the current room and adds it to the player’s inventory, returning an updated GameSession.
  • If the room referenced by GameState.currentRoom cannot be found (world corruption), the method throws IllegalStateException.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Dust
class Potion
class Weapon

Members list

Value members

Concrete methods

def pick(item: Item, gameSession: GameSession): GameSession

Transfer item from floor to inventory.

Transfer item from floor to inventory.

Value parameters

gameSession

current session snapshot

item

the item being collected

Attributes

Returns

a new session with world and player updated