ItemFactory
scalata.application.services.factories.ItemFactory
class ItemFactory extends EntityFactory[ItemFactory, Item, ItemClasses]
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
- Graph
-
- Supertypes
Members list
In this article