Class ConsumableFactory
java.lang.Object
com.csse3200.game.entities.factories.items.ConsumableFactory
Factory class responsible for creating consumable items in the game.
Consumables can either be standard items that apply effects directly
or projectile-based items (e.g., bombs or throwable items) that
use RangedUseComponent
and WeaponsStatsComponent
.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Entity
createConsumable
(Consumables consumableType) Creates a consumable entity of the specified type.
-
Constructor Details
-
ConsumableFactory
public ConsumableFactory()
-
-
Method Details
-
createConsumable
Creates a consumable entity of the specified type.The returned entity will have:
- A
ConsumableComponent
containing its effects and duration - A
ConsumableUseComponent
to handle usage - Optional projectile behavior if the configuration specifies a projectile
- Its item type set to
ItemTypes.CONSUMABLE
- Parameters:
consumableType
- the type of consumable to create- Returns:
- the created consumable entity
- A
-