Class ItemFactory

java.lang.Object
com.csse3200.game.entities.factories.ItemFactory

public class ItemFactory extends Object
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 Details

    • createItem

      public static Entity createItem(Entity target, AbstractItem item)
      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

      public static Entity createHealthPotion(Entity target)
      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

      public static Entity createDefensePotion(Entity target)
      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

      public static Entity createSpeedPotion(Entity target)
      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

      public static Entity createAttackPotion(Entity target)
      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

      public static Entity createApple(Entity target)
      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

      public static Entity createCarrot(Entity target)
      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

      public static Entity createCandy(Entity target)
    • createChickenLeg

      public static Entity createChickenLeg(Entity target)
    • createMeat

      public static Entity createMeat(Entity target)
    • createShrimp

      public static Entity createShrimp(Entity target)
    • createFriedFish

      public static Entity createFriedFish(Entity target)
    • createCloudCupcakes

      public static Entity createCloudCupcakes(Entity target)
    • createCloudCookie

      public static Entity createCloudCookie(Entity target)
    • createCottonCLoud

      public static Entity createCottonCLoud(Entity target)