Package model.itemesAndRewards
Class RewardPointsManagerModel
java.lang.Object
model.itemesAndRewards.RewardPointsManagerModel
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 Summary
Modifier and TypeMethodDescriptionvoidaddBigPoints(int value) Adds big points (point generated my popping bubbles) to the player's score and creates a new points item.voidaddChainReactionReward(int consecutivePops) Adds a points to the player based on the number of consecutive pops, calculated by theChainReactionManagerclass.voidaddSmallPoints(int value) Adds small points (points generated collecting items) to the player's score and creates a new points item.static RewardPointsManagerModelReturns the singleton instance of the RewardPointsManagerModel.Returns the list of points items.voidResets the state of the reward points manager for a new level.voidResets the state of the reward points manager for a new play session.voidupdate()Updates the state of all active the reward points, including timers and chain reaction rewards.
-
Method Details
-
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 theChainReactionManagerclass.- 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
Returns the list of points items.- Returns:
- the list of points items
-