Class SpecialBubbleManagerModel

java.lang.Object
model.bubbles.specialBubbles.SpecialBubbleManagerModel

public class SpecialBubbleManagerModel extends Object
Manages special bubbles that are not generated by the player, such as water bubbles and lighting bubbles.

This singleton class is responsible for updating, adding, and managing the state of special bubbles and water flows (WaterFlowModel). It interacts with the PlayerModel and the LevelManagerModel to handle bubble generation and collisions.

  • Method Details

    • getInstance

      public static SpecialBubbleManagerModel getInstance()
      Returns the singleton instance of the SpecialBubbleManagerModel.
      Returns:
      the singleton instance
    • update

      public void update()
      Updates the state of all active special bubbles and water flows.

      This method updates the bubble generator, checks for collisions with the player, and updates the state of each bubble and water flow.

    • loadBubbleGenerator

      public void loadBubbleGenerator()
      Loads the bubble generator (BubbleGenerator) for the current level.
    • newLevelReset

      public void newLevelReset()
      Resets the state of the manager for a new level.

      This method clears all active bubbles and water flows.

    • newPlayReset

      public void newPlayReset()
      Resets the state of the manager for a new play session.

      This method calls newLevelReset() to clear all active bubbles and water flows.

    • addBubble

      public void addBubble(SpecialBubbleModel bubble)
      Adds a new special bubble to the manager.
      Parameters:
      bubble - the special bubble to add
    • addWaterFlow

      public void addWaterFlow(WaterFlowModel waterFlowModels)
      Adds a new water flow to the manager.
      Parameters:
      waterFlowModels - the water flow to add
    • getActiveBubblesCount

      public int getActiveBubblesCount()
      Returns the count of active special bubbles.
      Returns:
      the count of active special bubbles
    • getBubblesModels

      public LinkedList<SpecialBubbleModel> getBubblesModels()
      Returns the list of special bubbles managed by this class.
      Returns:
      the list of special bubbles
    • getWaterFlowsModels

      public LinkedList<WaterFlowModel> getWaterFlowsModels()
      Returns the list of water flows managed by this class.
      Returns:
      the list of water flows