-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Wee Heng] IP #312
base: master
Are you sure you want to change the base?
[Wee Heng] IP #312
Conversation
Echoes the commands inputted by the user
implemented the ability to add tasks to a list and to display it
Added a new class task to help with marking and unmarking
made Todo, Event and Deadline extend from task
added input.txt and expected.txt and ensure test passed
Implemented DukeInvalidArgumentException and DukeException. handles when todo has no description and invalid command
Allows for deletion of tasks
src/main/java/duke/Duke.java
Outdated
} | ||
Task taskToMark = taskList.get(taskToMarkNumber - 1); | ||
taskToMark.markAsDone(); | ||
System.out.println("Duly noted. The following task has been marked as done"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe can add a method displayMark for the print message as what you did earlier 👍
src/main/java/duke/Duke.java
Outdated
} | ||
Task taskToUnmark = taskList.get(taskToUnmarkNumber - 1); | ||
taskToUnmark.markAsNotDone(); | ||
System.out.println("Very well. The following task has been marked as undone"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above displayUnmark
src/main/java/duke/tasks/Task.java
Outdated
|
||
public class Task { | ||
String content; | ||
boolean markedDone = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boolean var can be named as isDone
src/main/java/duke/Duke.java
Outdated
public static void displayTaskList() { | ||
if (taskList.isEmpty()) { | ||
System.out.println("Your current task list is empty"); | ||
return; | ||
} | ||
int taskCounter = 1; | ||
System.out.println("These are the current tasks in your list:"); | ||
for(Task task:taskList) { | ||
System.out.printf("%d. %s \n", taskCounter, task.toString()); | ||
taskCounter++; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you can use a TaskList object to separate out each user's task lists and bundle away all related methods like displaying/adding/removing to the list?
src/main/java/duke/tasks/Task.java
Outdated
|
||
public class Task { | ||
String content; | ||
boolean markedDone = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boolean markedDone = false; | |
boolean isMarkedDone = false; |
src/main/java/duke/Duke.java
Outdated
public class Duke { | ||
|
||
private static ArrayList<Task> taskList; | ||
private static Scanner getUserInput; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getUserInput sounds like a method name. Perhaps consider changing it to
private static Scanner getUserInput; | |
private static Scanner sc; |
src/main/java/duke/Duke.java
Outdated
public static String[] parseArguments(String[] arguments) throws DukeInvalidArgumentException { | ||
if (arguments.length < 2) { | ||
throw new DukeInvalidArgumentException("There appears to be invalid arguments"); | ||
} | ||
|
||
return arguments[1].split(" /([Aa][Tt]|[Bb][Yy]) ", 2); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe have some JavaDoc comments to explain non-trivial public methods?
package duke; | ||
|
||
import duke.exceptions.DukeInvalidArgumentException; | ||
import duke.tasks.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps list all imported classes explicitly?
Duke is now able to save and load the tasklist across different sessions
Deadline and Event tasks now take in LocalDateTime
This reverts commit 74a00d1.
This reverts commit 738ca50.
This reverts commit 3f0f903.
This reverts commit e6993ef.
Added functionality for storage to load tasks time as localdatetime
Extracted TextUI for interactions with user, Storage to load and save tasklist, Parser to parse inputs and Tasklist which contains tasklist operations
Removed unnecessary imports and fixed formatting
Added JUnit test for Parser parseCommand() and all functions in Task. Also removed redundant functions from TaskList
Rectified mistake in Intellij compiler and fixed related bugs like text blocks. fixed minor bugs like mark, unmark and delete allowing exceed of size. Improve UI
Added Java documentation and fixed a bug: delete command displaying wrong task being deleted.
Deleted unnecessary lines. Shortened code. Renamed variables.
Accommodate different time format in saveData
Allows users to search for tasks based on content. Added a toString() for TaskList and removed DisplayTaskList() from ListCommand
Javadoc for Find Command and related changes
Changed mainClassName in build.gradle
use FXML. Added resources and images.
Lack of assertions Certain assumptions at various points in the code needs to be checked Use assert method in java to validate assumptions like input Let's add relevant assertions
Overlook certain aspects of code quality Make code more readable and standardizing code formats Extracting certain functions and adopt "drill down" function approach Let's adhere to the code quality in the textbook
This reverts commit eb1d240.
This reverts commit eb1d240.
This reverts commit 75e98b3.
…into branch-A-Assertions
Overlook certain aspects of code quality Make code more readable and standardizing code formats Extracting certain functions and adopt "drill down" function approach Let's adhere to the code quality in the textbook
Update Code Quality
Add Assertions
Duke now has a sort command sort command displays tasks based on what type of task they are and in order of when they are due. Task happening sooner are displayed first.
Update so Duke notifies user if a certain type of event is not in the list
Added userguide on how to quick start, features and command summary
Added bubble message. Change image. Reduced window size.
Removed Data
parseindex and parseDatetime throws error if not parsable
DukePlus
DukePlus helps you organize your tasks in the form of a task list!
It is:
UselessEXTRAORDINARILY USEFULAll you have to do to start using this amazing product is:
Best part is DukePro
costs as much as it's worth. I mean pricelessis FREE!Features:
If you are a Java Programmer, you can use it to practice Java too. Here's the
main
method: