Class CollectableFactory

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

public class CollectableFactory extends Object
Factory for creating collectable entities (e.g., keys, coins, potions).
  • Constructor Details

    • CollectableFactory

      public CollectableFactory()
  • Method Details

    • createCollectable

      public static Entity createCollectable(String itemId)
      Creates a new collectable entity instance based on its configuration ID.

      The returned entity includes:

      Parameters:
      itemId - the identifier of the collectable, as defined in items.json
      Returns:
      a collectable Entity
      Throws:
      IllegalArgumentException - if itemId is not registered
    • createKey

      public static Entity createKey(String target)
      Builds a collectable key for target.
      Returns:
      a new key entity
      See Also:
    • createDashUpgrade

      public static Entity createDashUpgrade()
      Builds a collectable upgrade that enable the dash ability
      Returns:
      a new upgrade entity
      See Also:
    • createGlideUpgrade

      public static Entity createGlideUpgrade()
      Build a new collectable glider upgrade that enables the glide ability
      Returns:
      a new upgrade entity
      See Also:
    • createGrappleUpgrade

      public static Entity createGrappleUpgrade()
      Builds a new collectable grappler upgrade that enables the grapple ability
      Returns:
      a new upgrade entity
      See Also: