Class ItemFactory

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

public class ItemFactory extends Object
Utility factory class for creating item entities in the game.

Each item entity type should have a creation method that returns a corresponding entity.

  • Method Details

    • createItem

      public static Entity createItem(String texture)
      Creates and configures a new item entity. The item has a texture, physics, and other needed parts. This class is called by other Factories, to add other components as needed.
      Parameters:
      texture - texture path of the item's texture
      Returns:
      entity representing an item