forked from nus-cs2103-AY2223S1/ip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tasks cannot be marked as done or not done yet. Add functionality for marking and unmarking
- Loading branch information
1 parent
8d259a9
commit 6164900
Showing
2 changed files
with
54 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
public class Task { | ||
protected String description; | ||
protected boolean isDone; | ||
|
||
protected static int count = 0; | ||
|
||
public Task(String description) { | ||
this.description = description; | ||
this.isDone = false; | ||
count++; | ||
} | ||
|
||
public void mark(){ | ||
isDone = true; | ||
} | ||
|
||
public void unmark() { | ||
isDone = false; | ||
} | ||
|
||
public String getStatusIcon() { | ||
return (isDone ? "X" : " "); // mark done task with X | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "[" + getStatusIcon() + "] " + this.description; | ||
} | ||
|
||
} |