Alive

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

Capability mix-in for entities that possess hit-points.

Type parameters

E

concrete entity type that mixes in Alive

Attributes

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

Members list

Value members

Abstract methods

def heal(amount: Int): E

Heal the entity (never exceeds maxHealth).

Heal the entity (never exceeds maxHealth).

Attributes

def isAlive: Boolean

true when health > 0.

true when health > 0.

Attributes

def takeDamage(damage: Int): E

Apply damage and return the updated entity.

Apply damage and return the updated entity.

Attributes

Abstract fields

val health: Int
val maxHealth: Int