Class CatalogService

java.lang.Object
com.csse3200.game.components.shop.CatalogService

public class CatalogService extends Object
Provides access to a collection of CatalogEntry objects.

The CatalogService acts as a container for catalog entries, allowing lookup and retrieval of items available in the shop.

  • Constructor Details

    • CatalogService

      public CatalogService(List<CatalogEntry> entries)
      Constructs a CatalogService with a given list of entries.
      Parameters:
      entries - The catalog entries to manage. Must not be null.
  • Method Details

    • get

      public CatalogEntry get(CatalogEntry item)
      Retrieves a catalog entry that matches the specified item.

      The method performs an equality check against all entries in the service.

      Parameters:
      item - The catalog entry to search for.
      Returns:
      The matching CatalogEntry, or null if not found.
    • list

      public List<CatalogEntry> list()
      Returns the complete list of catalog entries managed by this service.
      Returns:
      A list of CatalogEntry objects.