Class Decision
java.lang.Object
com.csse3200.game.components.moral.Decision
The Decision class represents a moral decision with a statement,
whether it is good or bad, and associated decision points.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the decision made.intReturns the points associated with the decision.Returns the statement of the decision.booleanisGood()Returns whether the decision is good.booleansetDecision(boolean decision) Sets the decision to the specified value.booleansetPoints(int points) Sets the points associated with the decision.
-
Constructor Details
-
Decision
Constructs a new Decision with the specified statement, goodness, and decision points.- Parameters:
statement- the statement of the decisionisGood- whether the decision is gooddecisionPoints- points associated with the decision
-
-
Method Details
-
getStatement
Returns the statement of the decision.- Returns:
- the statement of the decision
-
getDecision
public boolean getDecision()Returns the decision made.- Returns:
- the decision made. If the decision has not been made, returns false.
-
getDecisionPoints
public int getDecisionPoints()Returns the points associated with the decision.- Returns:
- the decision points
-
isGood
public boolean isGood()Returns whether the decision is good.- Returns:
- true if the decision is good, false otherwise
-
setDecision
public boolean setDecision(boolean decision) Sets the decision to the specified value. The decision can only be set once.- Parameters:
decision- the decision to set- Returns:
- true if the decision was set successfully
-
setPoints
public boolean setPoints(int points) Sets the points associated with the decision.- Parameters:
points- the points to set- Returns:
- true if the points were set successfully
-