scalata.application.services.factories
Members list
Type members
Classlikes
class EnemyFactory extends EntityFactory[EnemyFactory, Enemy, EnemyClasses]
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 tocreate.
The factory is pure: every call returns a fresh instance; no shared state is mutated.
Attributes
- Supertypes
class ItemFactory extends EntityFactory[ItemFactory, Item, ItemClasses]
Factory that produces every kind of in-game item.
Factory that produces every kind of in-game item.
==== Responsibilities ====
- Loot box generation –
createBoxdecides at runtime whether the chest contains a potion, a weapon or plain dust, using weighted randomness that scales with thedifficultyparameter. - Direct creation –
createinstantiates 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 PlayerFactory extends EntityFactory[PlayerFactory, Player, PlayerClasses]
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
In this article