Package com.csse3200.game.overlays
Class Overlay
java.lang.Object
com.csse3200.game.overlays.Overlay
- Direct Known Subclasses:
PauseOverlay
,PlayerStatsOverlay
,QuestOverlay
,SettingsOverlay
,SnakePopupOverlay
Represents a general overlay in the game that manages a collection of entities.
provides functionality for adding, removing, and managing
entities within the overlay.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enumeration of different types of overlays. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOverlay
(Overlay.OverlayType overlayType) Constructs an overlay with a specified type. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an entity to the overlay.static Map
<Overlay.OverlayType, Boolean> Creates a map of all overlay types with their active status set to false.void
remove()
Removes all entities from the overlay and disposes of them.void
rest()
Puts the overlay into a resting state by disabling all entities.void
wake()
Wakes the overlay by enabling all entities.
-
Field Details
-
overlayType
-
-
Constructor Details
-
Overlay
Constructs an overlay with a specified type.- Parameters:
overlayType
- the type of the overlay
-
-
Method Details
-
add
Adds an entity to the overlay.- Parameters:
entity
- the entity to add
-
remove
public void remove()Removes all entities from the overlay and disposes of them. This method clears the list of entities and disposes each one, releasing any associated resources. -
rest
public void rest()Puts the overlay into a resting state by disabling all entities. -
wake
public void wake()Wakes the overlay by enabling all entities. -
getNewActiveOverlayList
Creates a map of all overlay types with their active status set to false.- Returns:
- a map with ative status
-