Skip to content

Commit

Permalink
Sanity Tests(new file EventTest.java added) for Event.java completed!
Browse files Browse the repository at this point in the history
  • Loading branch information
Krish Patel committed Dec 6, 2022
1 parent f2cf534 commit 8f743e0
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions observer/Goal.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class Goal implements EventObserver, Serializable {

private String name; // The goal's name
private int currentPoints; // The amount of points the user has currently earned toward this goal
private int pointsToBadge; // The amount of points that are required to complete this goal
private final int pointsToBadge; // The amount of points that are required to complete this goal

/**
* Constructor for the Goal class. Takes a name and a point value.
Expand All @@ -34,12 +34,7 @@ public Goal(String name, int p) {
@Override
public boolean addPoints(int points) {
this.currentPoints += points;
if (this.currentPoints >= this.pointsToBadge) {
return true;
}
else {
return false;
}
return this.currentPoints >= this.pointsToBadge;
}

/**
Expand All @@ -49,12 +44,6 @@ public boolean addPoints(int points) {
*/
public String getName() {return this.name;}

/**
* Change the name of this Goal.
*
* @param n the Goal's new name.
*/
public void setName(String n) { this.name = n;}

/**
* Get the string representation of this goal. If the goal is incomplete, its string representation looks like this:
Expand Down

0 comments on commit 8f743e0

Please sign in to comment.