Module edu.ntnu.idatt2001.paths
Class MaximumScoreGoal
java.lang.Object
edu.ntnu.idatt2001.paths.models.goals.MaximumScoreGoal
MinimumScoreGoal class.
Checks if the player's score is less than or equal to a certain amount.
The amount of score for fulfillment is defined when instantiated.
Players can start with negative score and the maximum
score can therefore also be negative.
- Version:
- 0.4 - 29.04.2023
- Author:
- Carl G. Callum G.
-
Constructor Summary
ConstructorsConstructorDescriptionMaximumScoreGoal(int maximumScore) Creates a new score goal which checks the player's score with the maximum score. -
Method Summary
Modifier and TypeMethodDescriptionGet the score goal's maximum score criteria.booleanisFulfilled(Player player) Checks if a player has fulfilled the score goal.
-
Constructor Details
-
MaximumScoreGoal
public MaximumScoreGoal(int maximumScore) Creates a new score goal which checks the player's score with the maximum score.- Parameters:
maximumScore- int - the amount of score for fulfillment
-
-
Method Details
-
isFulfilled
Checks if a player has fulfilled the score goal. Calls the getScore method and checks if it is less than or equal to the maximum score- Specified by:
isFulfilledin interfaceGoal<Integer>- Parameters:
player- Player - the player to check the goal with.- Returns:
- boolean - true if the goal is fulfilled, false otherwise.
- Throws:
NullPointerException- if player is null- See Also:
-
getFulfillmentCriteria
Get the score goal's maximum score criteria.- Specified by:
getFulfillmentCriteriain interfaceGoal<Integer>- Returns:
- Integer - the maximum score criteria
- See Also:
-