Skip to content

Bui Phuong Nam ip#236

Open
arsdorintbp2003 wants to merge 53 commits into
nus-cs2113-AY2223S2:masterfrom
arsdorintbp2003:master
Open

Bui Phuong Nam ip#236
arsdorintbp2003 wants to merge 53 commits into
nus-cs2113-AY2223S2:masterfrom
arsdorintbp2003:master

Conversation

@arsdorintbp2003

Copy link
Copy Markdown

No description provided.

@exetr exetr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good progress on your iP! I have left some comments regarding some areas for improvement.

package Arsdorint.task;

public class Deadline extends Task {
public static final String typeDeadline = "D";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider renaming your constant variables to all uppercase in order to maintain consistency and adhere to the module's coding standards.

Comment thread src/main/java/Arsdorint/task/Event.java Outdated
package Arsdorint.task;

public class Event extends Task {
public static final String typeEvent = "E";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, consider renaming your constant variables to all uppercase

Comment thread src/main/java/Arsdorint/Arsdorint.java Outdated
Comment on lines +17 to +56
private static final int MAX_NUM_OF_TASKS = 100;
private static final String EXIT_MESSAGE = " Bye. Hope to see you again soon!\n";
private static final String HELLO_MESSAGE =
" Hello! I'm Arsdorint, a member of Arsdorint Team.\n" +
" Please Type The Command As Follow:\n";
private static final String COMMAND_LIST_MESSAGE =
"> Type \"list\" to list all the tasks. \n" +
"> Type \"mark\" follow by a number x to mark x tasks in the list. \n" +
"> Type \"unmark\" follow by a number y to unmark y tasks in the list. \n" +
"> Type \"todo\" follow by a string x to add a work that need to be done. \n" +
"> Type \"deadline /x y\" with x is the type of work, y is the time or date of the deadline. \n" +
"> Type \"event x /y\" with x is the event, y is the time or date of that event. \n" +
"> Type \"bye\" to exit. \n";
private static final String QUESTION = " What can I do for you?";

private static final String STORAGE_DIRECTORY = "./storage";
private static final String STORAGE_FILE_NAME = "./storage/arsdorintTask.txt";
private static final String MESSAGE_NEW_FILE = "File created";
private static final String MESSAGE_OVERWRITE_FILE = "File overwritten";
private static final String MESSAGE_LOAD_FILE = "File loaded";
private static final String MESSAGE_NO_FILE = "There is no existing file";
private static final String MESSAGE_WRONG_FILE = "The storage files entry is invalid. Please save to overwrite";
private static final String MESSAGE_DIVIDER =
"____________________________________________________________";
private static final String MESSAGE_DIVIDER_LIST =
"____________________________LIST____________________________";
private static final String MESSAGE_DELETE = "Noted. I've removed this task:";

private static final String ERROR_MESSAGE_BYE = " ";
private static final String ERROR_MESSAGE_LIST = " ";
private static final String ERROR_MESSAGE_MARK =
"=( OOPS!!! The description of a mark cannot be empty.\n" + "Syntax for mark\n\t" +
">>> mark <item index number> \n" + "Note: item index must exist in the current list";
private static final String ERROR_MESSAGE_UNMARK =
"=( OOPS!!! The description of an unmark cannot be empty.\n" + "Syntax for unmark\n\t" +
">>> unmark <item index number> \n" + "Note: item index must exist in the current list";
private static final String ERROR_MESSAGE_TODO =
"=( OOPS!!! The description of a todo cannot be empty.\n" + "Syntax for todo\n\t>>> todo <task>";
private static final String ERROR_MESSAGE_DEADLINE =
"=( OOPS!!! The description of a deadline cannot be empty.\n" +

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can consider relocating all your messages to a separate java file in order to improve code readability of Arsdorint.java.

Comment thread src/main/java/Arsdorint/Arsdorint.java Outdated


public static void removeTaskMessage(int idx) {
//showToUser(MESSAGE_DIVIDER);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you no longer plan to use this line of code, consider removing it.

Comment thread src/main/java/Arsdorint/Arsdorint.java Outdated
Comment on lines +306 to +328
if (lowerCaseLine.equals("bye")) exit();
else if (lowerCaseLine.contains("list")) {
System.out.println("Here are the tasks in your list:\n");
list();
}
else if (lowerCaseLine.equalsIgnoreCase("mark")) {
mark(splitLine);
}
else if (lowerCaseLine.equalsIgnoreCase("unmark")) {
unmark(splitLine);
}
else if (lowerCaseLine.equalsIgnoreCase("todo") ||
lowerCaseLine.equalsIgnoreCase("deadline") ||
lowerCaseLine.equalsIgnoreCase("event")) add(command);
//add command when user don't type the instruction's TaskList.command
else if (lowerCaseLine.equalsIgnoreCase("delete")) {
delete(splitLine);
}
else if (lowerCaseLine.equalsIgnoreCase("save")) {
save();
}
else wrongCommandMessage();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider re-organising this if-else block to match the format stated in the coding standard, in order to maintain consistnecy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants