Class CatalogService
java.lang.Object
com.csse3200.game.components.shop.CatalogService
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 Summary
ConstructorsConstructorDescriptionCatalogService
(List<CatalogEntry> entries) Constructs aCatalogService
with a given list of entries. -
Method Summary
Modifier and TypeMethodDescriptionget
(CatalogEntry item) Retrieves a catalog entry that matches the specified item.list()
Returns the complete list of catalog entries managed by this service.
-
Constructor Details
-
CatalogService
Constructs aCatalogService
with a given list of entries.- Parameters:
entries
- The catalog entries to manage. Must not benull
.
-
-
Method Details
-
get
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
, ornull
if not found.
-
list
Returns the complete list of catalog entries managed by this service.- Returns:
- A list of
CatalogEntry
objects.
-