Class EmptyBubbleModel

Direct Known Subclasses:
EnemyBubbleModel

public class EmptyBubbleModel extends PlayerBubbleModel
Represents an empty bubble created by the player.

This class extends the PlayerBubbleModel and provides specific behavior for empty bubbles. Empty bubbles do not have any special behavior when they are in the dead state.

  • Constructor Details

    • EmptyBubbleModel

      public EmptyBubbleModel(float x, float y, Constants.Direction direction)
      Constructs a new EmptyBubbleModel.
      Parameters:
      x - the starting x coordinate
      y - the starting y coordinate
      direction - the starting direction
  • Method Details

    • updateDeadAction

      protected void updateDeadAction()
      Updates the bubble's movement after it has been popped by the player. Overrides the updateDeadAction method from PlayerBubbleModel.

      Empty bubbles do not have any special behavior, so this method is empty.

      Specified by:
      updateDeadAction in class PlayerBubbleModel
    • pop

      public void pop()
      Pops the bubble and updates its state. Overrides the pop method from PlayerBubbleModel to pop the empty bubble.

      Called when the bubble pops and is used to change the state of the bubble to the correct pop state based on the previous state before the bubble was popped.

      Specified by:
      pop in class PlayerBubbleModel
    • playerPop

      public void playerPop(PlayerModel playerModel, int EnemyBubblePopCounter, ChainReactionManager chainReactionManager)
      Handles the player popping the bubble, this overloaded method is used only by the ChainReactionManager. Overrides the playerPop method from PlayerBubbleModel to handle the player popping the bubble.

      Called when the player pops the bubble, and is used to change the state of the bubble to the correct pop state based on the previous state before the bubble was popped.

      In this case when and empty bubble is popped, it will just simply pop using the pop() method.

      Specified by:
      playerPop in class PlayerBubbleModel
      Parameters:
      playerModel - the player model
      EnemyBubblePopCounter - the number of enemy bubbles popped
      chainReactionManager - the chain explosion manager