Class Decision

java.lang.Object
com.csse3200.game.components.moral.Decision

public class Decision extends Object
The Decision class represents a moral decision with a statement, whether it is good or bad, and associated decision points.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Decision(String statement, boolean isGood, int decisionPoints)
    Constructs a new Decision with the specified statement, goodness, and decision points.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the decision made.
    int
    Returns the points associated with the decision.
    Returns the statement of the decision.
    boolean
    Returns whether the decision is good.
    boolean
    setDecision(boolean decision)
    Sets the decision to the specified value.
    boolean
    setPoints(int points)
    Sets the points associated with the decision.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Decision

      public Decision(String statement, boolean isGood, int decisionPoints)
      Constructs a new Decision with the specified statement, goodness, and decision points.
      Parameters:
      statement - the statement of the decision
      isGood - whether the decision is good
      decisionPoints - points associated with the decision
  • Method Details

    • getStatement

      public String 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