Class ItemFactory
java.lang.Object
com.csse3200.game.entities.factories.ItemFactory
A factory class for creating various item entities in the game.
This class provides methods to create different items like health potions and apples.
with specific behaviours such proximity detection using AI tasks and physics components
-
Method Summary
Modifier and TypeMethodDescriptionstatic Entity
createApple
(Entity target) Creates an apple entity that interacts with the specified target.static Entity
createAttackPotion
(Entity target) Creates an attack potion entity that interacts with the specified target.static Entity
createCandy
(Entity target) static Entity
createCarrot
(Entity target) Creates a carrot entity that interacts with the specifc targetstatic Entity
createChickenLeg
(Entity target) static Entity
createCloudCookie
(Entity target) static Entity
createCloudCupcakes
(Entity target) static Entity
createCottonCLoud
(Entity target) static Entity
createDefensePotion
(Entity target) Creates a defense potion entity that interacts with the specified target.static Entity
createFriedFish
(Entity target) static Entity
createHealthPotion
(Entity target) Creates a health potion entity that interacts with the specified target.static Entity
createItem
(Entity target, AbstractItem item) Creates an item entity with the specified target and item.static Entity
createMeat
(Entity target) static Entity
createShrimp
(Entity target) static Entity
createSpeedPotion
(Entity target) Creates a speed potion that interacts with the specified target
-
Method Details
-
createItem
Creates an item entity with the specified target and item. The entity is configured with a texture, physics and AI components- Parameters:
target
- The entity that the item will interact with (e.g., the player).item
- The specific item to create an entity of (e.g., potions, food items).- Returns:
- The created item entity, fulled configured with its components
-
createHealthPotion
Creates a health potion entity that interacts with the specified target.- Parameters:
target
- The entity the health potion will interact with- Returns:
- The created health potion entity.
-
createDefensePotion
Creates a defense potion entity that interacts with the specified target.- Parameters:
target
- The entity the defense potion will interact with- Returns:
- The created health potion entity.
-
createSpeedPotion
Creates a speed potion that interacts with the specified target- Parameters:
target
- the entity the speed potion will interact with- Returns:
- the created health potion entity
-
createAttackPotion
Creates an attack potion entity that interacts with the specified target.- Parameters:
target
- The entity the attack potion will interact with- Returns:
- The created attack potion entity
-
createApple
Creates an apple entity that interacts with the specified target.- Parameters:
target
- The entity the apple with interact with- Returns:
- The created apple entity.
-
createCarrot
Creates a carrot entity that interacts with the specifc target- Parameters:
target
- The entity the apple with interact with- Returns:
- the created carrot entity
-
createCandy
-
createChickenLeg
-
createMeat
-
createShrimp
-
createFriedFish
-
createCloudCupcakes
-
createCloudCookie
-
createCottonCLoud
-