Class Overlay

java.lang.Object
com.csse3200.game.overlays.Overlay
Direct Known Subclasses:
PauseOverlay, PlayerStatsOverlay, QuestOverlay, SettingsOverlay, SnakePopupOverlay

public class Overlay extends Object
Represents a general overlay in the game that manages a collection of entities. provides functionality for adding, removing, and managing entities within the overlay.
  • Field Details

  • Constructor Details

    • Overlay

      public Overlay(Overlay.OverlayType overlayType)
      Constructs an overlay with a specified type.
      Parameters:
      overlayType - the type of the overlay
  • Method Details

    • add

      public void add(Entity entity)
      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

      public static Map<Overlay.OverlayType,Boolean> getNewActiveOverlayList()
      Creates a map of all overlay types with their active status set to false.
      Returns:
      a map with ative status