PlayerFactory

scalata.application.services.factories.PlayerFactory

Factory that creates a fresh Player for the requested scalata.domain.util.PlayerClasses.

The factory is pure: every call returns a brand-new instance and does not cache or mutate shared state.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def create(playerClass: PlayerClasses, id: String): Player

Build a player of the specified archetype.

Build a player of the specified archetype.

Value parameters

id

unique identifier (defaults to "p1")

playerClass

hero archetype to instantiate

Attributes

Returns

freshly constructed Player