Class ItemFactory
java.lang.Object
com.deco2800.game.entities.factories.ItemFactory
- Direct Known Subclasses:
ClueItemFactory,ConsumableItemFactory
Factory to create item entities with predefined components.
Each item entity type should have a creation method that returns a corresponding entity. Predefined entity properties can be loaded from configs stored as json files which are defined in "ItemConfigs".
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic EntitycreateItem(int id) Create an item with the specified id.static EntitycreateItem(Entity target, String texturePath) Deprecated.static EntitycreateItem(String name) Create an item with the specified name.
-
Constructor Details
-
ItemFactory
public ItemFactory()
-
-
Method Details
-
createItem
Create an item with the specified id.- Parameters:
id- item id- Returns:
- the item entity
-
createItem
Create an item with the specified name.- Parameters:
name- item name- Returns:
- item entity
-
createItem
Deprecated.Creates an item entity.- Parameters:
target- entity to chase- Returns:
- entity
-