scalata.domain.entities.components
Members list
Type members
Classlikes
Entity that can engage in combat.
Entity that can engage in combat.
-
attackPower – base damage dealt by the entity.
-
attack – pure function: returns a new instance of the opponent after damage has been applied.
Type parameters
- E
-
concrete opponent type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Capability mix-in for entities that own a inventory plus an optional equipped weapon.
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
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class Player
Capability mix-in for entities that can change their position.
Capability mix-in for entities that can change their position.
==== Contract ====
-
position – current tile coordinate.
-
move – returns a new instance at a different
Point2D; never mutates in place.
Type parameters
- E
-
concrete entity type that implements the trait
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Mixin for every item that the player can pick up.
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.currentRoomcannot be found (world corruption), the method throwsIllegalStateException.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Type-class describing an item that can be used by an entity.
Type-class describing an item that can be used by an entity.
==== Contract ====
-
A – concrete item subtype.
-
E – entity subtype that can own / use the item.
-
usereturns a new instance of the owner reflecting the item’s effect (pure, no mutation).
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Inline helper that tries to use a runtime item if a matching Usable instance is available.
Inline helper that tries to use a runtime item if a matching Usable instance is available.
The method performs an inline pattern-match on the concrete item type and, through summonInline, obtains the given instance for Potion, Dust or Weapon. Unsupported items yield None.