Inventory

scalata.domain.entities.components.Inventory
trait Inventory[E <: Inventory[E]]

Capability mix-in for entities that own a inventory plus an optional equipped weapon.

  • inventory – list of items currently held.

  • weapon – optional equipped Weapon.

  • equipWeapon – returns a new instance with the weapon set.

  • addItem – adds an item to the inventory.

  • getItem – finds an item by (trimmed, case-insensitive) name.

  • removeItem – deletes an item from the inventory.

Type parameters

E

concrete entity type that mixes in Inventory

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Player

Members list

Value members

Abstract methods

def addItem(item: Item): E
def equipWeapon(weapon: Weapon): E
def getItem(itemName: String): Option[Item]
def removeItem(item: Item): E

Abstract fields

val inventory: List[Item]
val weapon: Option[Weapon]