Package com.csse3200.game.services
Class CodexService
java.lang.Object
com.csse3200.game.services.CodexService
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
Service for managing all codex entries in the game
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Clears the map of all entries.getEntries(boolean unlockedOnly) Returns all unlocked entries currently stored by the service as an array list.Returns an entry held by the service using the key (or id) of the entry.intvoid
-
Constructor Details
-
CodexService
public CodexService()Constructor loads all codex entries from a special file.
-
-
Method Details
-
getEntry
Returns an entry held by the service using the key (or id) of the entry.- Parameters:
id- The id of the entry.- Returns:
- The entry with the matching id, or null if it does not exist
-
incUnlockCount
public void incUnlockCount() -
getUnlockedCount
public int getUnlockedCount() -
getEntries
Returns all unlocked entries currently stored by the service as an array list. This list is sorted by the collection order of entries (new entries collected appear at end of list).- Parameters:
unlockedOnly- Flag for filtering any codex entries which have not been unlocked.- Returns:
- All unlocked entries stored by service as an array list.
-
dispose
public void dispose()Clears the map of all entries.- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable
-