scalata.application.services.factories

Members list

Type members

Classlikes

Factory responsible for creating every kind of Enemy.

Factory responsible for creating every kind of Enemy.

==== Capabilities ====

  • create – build a concrete enemy from an EnemyClasses tag.
  • randomGeneration – convenience helper that picks a random enemy family and delegates to create.

The factory is pure: every call returns a fresh instance; no shared state is mutated.

Attributes

Supertypes
class Object
trait Matchable
class Any

Factory that produces every kind of in-game item.

Factory that produces every kind of in-game item.

==== Responsibilities ====

  • Loot box generationcreateBox decides at runtime whether the chest contains a potion, a weapon or plain dust, using weighted randomness that scales with the difficulty parameter.
  • Direct creationcreate instantiates a concrete item from the scalata.domain.util.ItemClasses discriminator.

All methods are pure; they return fresh instances and never mutate shared state.

Attributes

Supertypes
class Object
trait Matchable
class Any

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

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

Supertypes
class Object
trait Matchable
class Any