Class RewardPointsManagerModel

java.lang.Object
model.itemesAndRewards.RewardPointsManagerModel

public class RewardPointsManagerModel extends Object
Manages the reward points (PointsModel) in the game.

The RewardPointsManagerModel class is responsible for handling the points (PointsModel) awarded to the player. It tracks the points items, manages the chain reaction rewards, and updates the state of the points items.

  • Method Details

    • getInstance

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

      public void update()
      Updates the state of all active the reward points, including timers and chain reaction rewards.
    • addSmallPoints

      public void addSmallPoints(int value)
      Adds small points (points generated collecting items) to the player's score and creates a new points item.
      Parameters:
      value - the value of the points to add
    • addBigPoints

      public void addBigPoints(int value)
      Adds big points (point generated my popping bubbles) to the player's score and creates a new points item.
      Parameters:
      value - the value of the points to add
    • addChainReactionReward

      public void addChainReactionReward(int consecutivePops)
      Adds a points to the player based on the number of consecutive pops, calculated by the ChainReactionManager class.
      Parameters:
      consecutivePops - the number of consecutive pops
    • newPlayReset

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

      public void newLevelReset()
      Resets the state of the reward points manager for a new level.
    • getPointsModelModelArray

      public ArrayList<PointsModel> getPointsModelModelArray()
      Returns the list of points items.
      Returns:
      the list of points items