Package model.bubbles.specialBubbles
Class SpecialBubbleManagerModel
java.lang.Object
model.bubbles.specialBubbles.SpecialBubbleManagerModel
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 Summary
Modifier and TypeMethodDescriptionvoidaddBubble(SpecialBubbleModel bubble) Adds a new special bubble to the manager.voidaddWaterFlow(WaterFlowModel waterFlowModels) Adds a new water flow to the manager.intReturns the count of active special bubbles.Returns the list of special bubbles managed by this class.static SpecialBubbleManagerModelReturns the singleton instance of the SpecialBubbleManagerModel.Returns the list of water flows managed by this class.voidLoads the bubble generator (BubbleGenerator) for the current level.voidResets the state of the manager for a new level.voidResets the state of the manager for a new play session.voidupdate()Updates the state of all active special bubbles and water flows.
-
Method Details
-
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
Adds a new special bubble to the manager.- Parameters:
bubble- the special bubble to add
-
addWaterFlow
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
Returns the list of special bubbles managed by this class.- Returns:
- the list of special bubbles
-
getWaterFlowsModels
Returns the list of water flows managed by this class.- Returns:
- the list of water flows
-