From e9f97e7d8ca8cf370b0e7cfec35464f4985645af Mon Sep 17 00:00:00 2001 From: "SKYLER\\User" Date: Fri, 9 Oct 2020 23:47:51 +0800 Subject: [PATCH 01/14] WeiSiong-Features2 updatedDuke --- src/main/java/seedu/duke/Duke.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/seedu/duke/Duke.java b/src/main/java/seedu/duke/Duke.java index b9f678300e..99edff90a7 100644 --- a/src/main/java/seedu/duke/Duke.java +++ b/src/main/java/seedu/duke/Duke.java @@ -1,6 +1,8 @@ package seedu.duke; +import seedu.duke.command.AddCommand; import seedu.duke.command.Command; +import seedu.duke.command.LogInCommand; import seedu.duke.exception.DukeException; import seedu.duke.parser.Parser; import seedu.duke.task.TaskList; @@ -32,14 +34,18 @@ public Duke() { public void run() { ui.showWelcome(); boolean isExit = false; - User currentUser = null; + User nowUser = null; while (!isExit) { try { String fullCommand = ui.readCommand(); ui.showLine(); // show the divider line ("_______") Command c = Parser.parse(fullCommand); - c.execute(users, ui/*, storage*/); - currentUser = c.getCurrentUser(); + c.execute(users, ui, nowUser/*, storage*/); + + if (c.isLogIn() == true) { + nowUser = c.getCurrentUser(); + } + //System.out.println(nowUser.getName()); isExit = c.isExit(); } catch (DukeException e) { ui.showError(e.getMessage()); From 854b7eaab6288c4fda6fc251068039c7d06a14c7 Mon Sep 17 00:00:00 2001 From: "SKYLER\\User" Date: Fri, 9 Oct 2020 23:48:27 +0800 Subject: [PATCH 02/14] Weisiong-Feature2 updatedclass --- src/main/java/seedu/duke/command/ByeCommand.java | 3 ++- src/main/java/seedu/duke/command/Command.java | 9 +++++++-- src/main/java/seedu/duke/command/LogInCommand.java | 6 +++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/main/java/seedu/duke/command/ByeCommand.java b/src/main/java/seedu/duke/command/ByeCommand.java index 56310c1c69..4a183a85ad 100644 --- a/src/main/java/seedu/duke/command/ByeCommand.java +++ b/src/main/java/seedu/duke/command/ByeCommand.java @@ -3,6 +3,7 @@ //import seedu.duke.storage.Storage; import seedu.duke.task.TaskList; import seedu.duke.ui.Ui; +import seedu.duke.user.User; import seedu.duke.user.UserList; /** @@ -15,7 +16,7 @@ public ByeCommand() { } //@Override - public void execute(UserList users, Ui ui/*, Storage storage*/) { + public void execute(UserList users, Ui ui, User nowUser/*, Storage storage*/) { isExit = true; ui.showBye(); } diff --git a/src/main/java/seedu/duke/command/Command.java b/src/main/java/seedu/duke/command/Command.java index ff4d131af9..a9257b9b6a 100644 --- a/src/main/java/seedu/duke/command/Command.java +++ b/src/main/java/seedu/duke/command/Command.java @@ -10,7 +10,8 @@ public abstract class Command { protected String input; protected boolean isExit = false; - protected User currentUser; + protected User currentUser = null; + protected boolean isLogIn = false; /** * Creates a new command. @@ -28,7 +29,7 @@ public Command(String input) { * @param ui the corresponding messages based on the task. * @throws DukeException if execution encounters error. */ - public abstract void execute(UserList users, Ui ui/*, Storage storage*/) throws DukeException; + public abstract void execute(UserList users, Ui ui, User nowUser/*, Storage storage*/) throws DukeException; public boolean isExit() { return isExit; @@ -37,4 +38,8 @@ public boolean isExit() { public User getCurrentUser() { return currentUser; } + + public boolean isLogIn() { + return isLogIn; + } } diff --git a/src/main/java/seedu/duke/command/LogInCommand.java b/src/main/java/seedu/duke/command/LogInCommand.java index ecae89560e..86140e996d 100644 --- a/src/main/java/seedu/duke/command/LogInCommand.java +++ b/src/main/java/seedu/duke/command/LogInCommand.java @@ -18,12 +18,16 @@ public LogInCommand(String input) { } @Override - public void execute(UserList users, Ui ui/*, Storage storage*/) throws DukeException { + public void execute(UserList users, Ui ui, User nowUser/*, Storage storage*/) throws DukeException { String[] parsedInputs = input.split(" /", 2); User newUser = new User(parsedInputs[0], parsedInputs[1]); currentUser = newUser; users.addUser(newUser); ui.greetUser(newUser); + isLogIn = true; + + System.out.println(users.getTotalUserCount()); + System.out.println(users.getUser(1).getName()); //storage.write(tasks); } } From 703769df5d7c7579683372bb88280266fde8ef0d Mon Sep 17 00:00:00 2001 From: "SKYLER\\User" Date: Fri, 9 Oct 2020 23:49:01 +0800 Subject: [PATCH 03/14] Weisiong-feature2:UpdatedCommands --- src/main/java/seedu/duke/parser/Parser.java | 23 +++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/main/java/seedu/duke/parser/Parser.java b/src/main/java/seedu/duke/parser/Parser.java index 8c03bd9461..26ce4761ed 100644 --- a/src/main/java/seedu/duke/parser/Parser.java +++ b/src/main/java/seedu/duke/parser/Parser.java @@ -1,5 +1,6 @@ package seedu.duke.parser; +import seedu.duke.command.AddCommand; import seedu.duke.command.ByeCommand; import seedu.duke.command.Command; //import seedu.duke.command.DeleteCommand; @@ -22,6 +23,7 @@ public class Parser { //private static final String COMMAND_FIND = "find"; private static final String COMMAND_BYE = "bye"; private static final String COMMAND_LOGIN = "login"; + private static final String COMMAND_ADD = "add"; /** @@ -54,6 +56,9 @@ public static Command parse(String input) throws DukeException { case COMMAND_LOGIN: checkLogInValidity(parsedInputs); return new LogInCommand(parsedInputs[1]); + case COMMAND_ADD: + checkAddValidity(parsedInputs); + return new AddCommand(parsedInputs[1]); case COMMAND_BYE: return new ByeCommand(); default: @@ -61,6 +66,24 @@ public static Command parse(String input) throws DukeException { } } + private static void checkAddValidity(String[] input) throws DukeException { + if (input.length < 2) { + throw new DukeException("There is no description in your add command!"); + } else if (!input[1].contains("/")) { + throw new DukeException("An add command needs to be in a 'name /day /time /location' format!"); + } + String[] position = input[1].split(" /",4); + if (position[0].isBlank()) { + throw new DukeException("There is no name in your add command!"); + } else if (position[1].isBlank()) { + throw new DukeException("There is no day in your add command!"); + } else if (position[2].isBlank()) { + throw new DukeException("There is no time in your add command!"); + } else if (position[3].isBlank()) { + throw new DukeException("There is no location in your add command!"); + } + + } /** From e8b905af2cc5ab61833d1812d53d46b12fb9344c Mon Sep 17 00:00:00 2001 From: "SKYLER\\User" Date: Fri, 9 Oct 2020 23:49:45 +0800 Subject: [PATCH 04/14] Weisiong-Feature2:UpdatedClass --- src/main/java/seedu/duke/task/Event.java | 6 +--- .../java/seedu/duke/timetable/Timetable.java | 33 +++++++++++++++++++ src/main/java/seedu/duke/ui/Ui.java | 13 ++++---- src/main/java/seedu/duke/user/UserList.java | 2 +- 4 files changed, 42 insertions(+), 12 deletions(-) diff --git a/src/main/java/seedu/duke/task/Event.java b/src/main/java/seedu/duke/task/Event.java index a1890be746..3c35147849 100644 --- a/src/main/java/seedu/duke/task/Event.java +++ b/src/main/java/seedu/duke/task/Event.java @@ -11,16 +11,12 @@ public Event(String description, String location, String timeStart, String timeE //setTaskType("E"); } - /** - * Returns the event detail of the task. - * @return the event detail of the task. - */ /*public String getAt() { //return at; }*/ @Override public String toString() { - return super.toString(); + return description + " " + location + " " + " " + timeStart + "-" + timeEnd; } } diff --git a/src/main/java/seedu/duke/timetable/Timetable.java b/src/main/java/seedu/duke/timetable/Timetable.java index 8f93c3e401..ccf165bb10 100644 --- a/src/main/java/seedu/duke/timetable/Timetable.java +++ b/src/main/java/seedu/duke/timetable/Timetable.java @@ -1,6 +1,9 @@ package seedu.duke.timetable; +import seedu.duke.task.Event; + import java.util.ArrayList; +import java.util.List; public class Timetable { protected ArrayList monTimetable; @@ -20,4 +23,34 @@ public Timetable() { this.satTimetable = new ArrayList<>(); this.sunTimetable = new ArrayList<>(); } + + public ArrayList getMonTimetable() { + return monTimetable; + } + + public ArrayList getTueTimetable() { + return tueTimetable; + } + + public ArrayList getWedTimetable() { + return wedTimetable; + } + + public ArrayList getThuTimetable() { + return thuTimetable; + } + + public ArrayList getFriTimetable() { + return friTimetable; + } + + public ArrayList getSatTimetable() { + return satTimetable; + } + + public ArrayList getSunTimetable() { + return sunTimetable; + } + + } \ No newline at end of file diff --git a/src/main/java/seedu/duke/ui/Ui.java b/src/main/java/seedu/duke/ui/Ui.java index bd93310245..e180909393 100644 --- a/src/main/java/seedu/duke/ui/Ui.java +++ b/src/main/java/seedu/duke/ui/Ui.java @@ -1,7 +1,7 @@ package seedu.duke.ui; //import seedu.duke.task.Deadline; -//import seedu.duke.task.Event; +import seedu.duke.task.Event; import seedu.duke.task.Task; import seedu.duke.task.TaskList; import seedu.duke.user.User; @@ -81,14 +81,15 @@ public void printList(TaskList taskList) { /** * Prints out the event task given by the user. * - * @param task the task to be added to the array list. + * @param event the task to be added to the array list. */ - /*public void printEvent(TaskList taskList, Event task) { - System.out.println("Got it! I've added the following event in the list:\n" + task); - System.out.println("Now now have " + taskList.getTotalTaskCount() + " tasks in the list."); - }*/ + public void printEvent(Event event, String date) { + System.out.println("Got it! I've added the following event in " + date + "\n" + event); + //System.out.println("Now now have " + taskList.getTotalTaskCount() + " tasks in the list."); + } public void printDone(Task task) { + System.out.println("Nice! I have marked this task as done:\n" + task); } diff --git a/src/main/java/seedu/duke/user/UserList.java b/src/main/java/seedu/duke/user/UserList.java index b54cea9625..b57d58ff44 100644 --- a/src/main/java/seedu/duke/user/UserList.java +++ b/src/main/java/seedu/duke/user/UserList.java @@ -30,7 +30,7 @@ public User getUser(int index) throws DukeException { try { return users.get(index - 1); } catch (IndexOutOfBoundsException e) { - throw new DukeException("Invalid task number! Type 'list' to get an overview of your tasks."); + throw new DukeException("Invalid user number!"); } } From a6cec49d76b97c77f87d09aa250e420c7a837e71 Mon Sep 17 00:00:00 2001 From: "SKYLER\\User" Date: Fri, 9 Oct 2020 23:50:17 +0800 Subject: [PATCH 05/14] WeiSiong-Feature2:AddFeature --- .../java/seedu/duke/command/AddCommand.java | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 src/main/java/seedu/duke/command/AddCommand.java diff --git a/src/main/java/seedu/duke/command/AddCommand.java b/src/main/java/seedu/duke/command/AddCommand.java new file mode 100644 index 0000000000..6216cee9ac --- /dev/null +++ b/src/main/java/seedu/duke/command/AddCommand.java @@ -0,0 +1,69 @@ +package seedu.duke.command; + +import seedu.duke.exception.DukeException; +//import seedu.duke.storage.Storage; +import seedu.duke.task.Event; +import seedu.duke.task.TaskList; +import seedu.duke.timetable.Timetable; +import seedu.duke.ui.Ui; +import seedu.duke.user.User; +import seedu.duke.user.UserList; + +/** + * Adds an event to the task list. + */ +public class AddCommand extends Command { + + public AddCommand(String input) { + super(input); + } + + @Override + public void execute(UserList users, Ui ui, User nowUser/*, Storage storage*/) throws DukeException { + //Lec /day /time /location + if (nowUser != null) { + String[] parsedInputs = input.split(" /", 4); + String[] timeInputs = parsedInputs[2].split("-", 2); + + String date = parsedInputs[1]; + + for (int i = 0; i < users.getTotalUserCount(); i++) { + if ((users.getUser(i + 1).getName() == nowUser.getName())) { + Event newEvent = new Event(parsedInputs[0], parsedInputs[3], timeInputs[0], timeInputs[1]); + ui.printEvent(newEvent, date); + switch (date) { + case "mon": + (users.getUser(i + 1).getTimetable()).getMonTimetable().add(newEvent); + break; + case "tue": + (users.getUser(i + 1).getTimetable()).getTueTimetable().add(newEvent); + break; + case "wed": + (users.getUser(i + 1).getTimetable()).getWedTimetable().add(newEvent); + break; + case "thu": + (users.getUser(i + 1).getTimetable()).getThuTimetable().add(newEvent);; + break; + case "fri": + (users.getUser(i + 1).getTimetable()).getFriTimetable().add(newEvent); + break; + case "sat": + (users.getUser(i + 1).getTimetable()).getSatTimetable().add(newEvent); + break; + case "sun": + (users.getUser(i + 1).getTimetable()).getSunTimetable().add(newEvent); + break; + default: + throw new DukeException("Sorry! I don't know what day you mean :-("); + } + } + } + //((Timetable) currentUser.getTimetable()) + //tasks.addTask(newTask); + //ui.printEvent(newEvent, date); + //storage.write(tasks); + } else { + throw new DukeException("Sorry! You are not Logged in to any account :-("); + } + } +} \ No newline at end of file From 6d87cb7393f6b5cb3959a20beee3dca49a6bfdef Mon Sep 17 00:00:00 2001 From: "SKYLER\\User" Date: Sat, 10 Oct 2020 00:14:28 +0800 Subject: [PATCH 06/14] updated .SH file for Features2 --- text-ui-test/runtest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text-ui-test/runtest.sh b/text-ui-test/runtest.sh index 1dcbd12021..d0fcf2c43b 100755 --- a/text-ui-test/runtest.sh +++ b/text-ui-test/runtest.sh @@ -11,7 +11,7 @@ cd text-ui-test java -jar $(find ../build/libs/ -mindepth 1 -print -quit) < input.txt > ACTUAL.TXT cp EXPECTED.TXT EXPECTED-UNIX.TXT -dos2unix EXPECTED-UNIX.TXT ACTUAL.TXT +#dos2unix EXPECTED-UNIX.TXT ACTUAL.TXT diff EXPECTED-UNIX.TXT ACTUAL.TXT if [ $? -eq 0 ] then From c6cf8e8f9964cac38821297944797a1eab80dbcc Mon Sep 17 00:00:00 2001 From: "SKYLER\\User" Date: Sat, 10 Oct 2020 00:18:20 +0800 Subject: [PATCH 07/14] Updated .sh for Features2 --- text-ui-test/runtest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text-ui-test/runtest.sh b/text-ui-test/runtest.sh index d0fcf2c43b..1dcbd12021 100755 --- a/text-ui-test/runtest.sh +++ b/text-ui-test/runtest.sh @@ -11,7 +11,7 @@ cd text-ui-test java -jar $(find ../build/libs/ -mindepth 1 -print -quit) < input.txt > ACTUAL.TXT cp EXPECTED.TXT EXPECTED-UNIX.TXT -#dos2unix EXPECTED-UNIX.TXT ACTUAL.TXT +dos2unix EXPECTED-UNIX.TXT ACTUAL.TXT diff EXPECTED-UNIX.TXT ACTUAL.TXT if [ $? -eq 0 ] then From ade692669359e05f3697ab9adffebbb601a6a4a1 Mon Sep 17 00:00:00 2001 From: "SKYLER\\User" Date: Sat, 10 Oct 2020 00:28:09 +0800 Subject: [PATCH 08/14] Updated Weisiong Feature2:Add --- src/main/java/seedu/duke/parser/Parser.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/seedu/duke/parser/Parser.java b/src/main/java/seedu/duke/parser/Parser.java index 26ce4761ed..cbae2c086b 100644 --- a/src/main/java/seedu/duke/parser/Parser.java +++ b/src/main/java/seedu/duke/parser/Parser.java @@ -73,13 +73,13 @@ private static void checkAddValidity(String[] input) throws DukeException { throw new DukeException("An add command needs to be in a 'name /day /time /location' format!"); } String[] position = input[1].split(" /",4); - if (position[0].isBlank()) { + if (position[0].isEmpty()) { throw new DukeException("There is no name in your add command!"); - } else if (position[1].isBlank()) { + } else if (position[1].isEmpty()) { throw new DukeException("There is no day in your add command!"); - } else if (position[2].isBlank()) { + } else if (position[2].isEmpty()) { throw new DukeException("There is no time in your add command!"); - } else if (position[3].isBlank()) { + } else if (position[3].isEmpty()) { throw new DukeException("There is no location in your add command!"); } @@ -127,9 +127,9 @@ private static void checkDeadlineValidity(String[] input) throws DukeException { throw new DukeException("A deadline task requires a '/by' to indicate time frame!"); } int byPosition = input[1].indexOf("/by"); - if (input[1].substring(0, byPosition).isBlank()) { + if (input[1].substring(0, byPosition).isEmpty()) { throw new DukeException("There is no description in your deadline command!"); - } else if (input[1].substring(byPosition + 3).isBlank()) { + } else if (input[1].substring(byPosition + 3).isEmpty()) { throw new DukeException("Please indicate time frame!"); } } @@ -147,9 +147,9 @@ private static void checkEventValidity(String[] input) throws DukeException { throw new DukeException("An event task requires an '/at' to indicate location!"); } int atPosition = input[1].indexOf("/at"); - if (input[1].substring(0, atPosition).isBlank()) { + if (input[1].substring(0, atPosition).isEmpty()) { throw new DukeException("There is no description in your event command!"); - } else if (input[1].substring(atPosition + 3).isBlank()) { + } else if (input[1].substring(atPosition + 3).isEmpty()) { throw new DukeException("An event task requires an '/at' to indicate location!"); } } @@ -161,9 +161,9 @@ private static void checkLogInValidity(String[] input) throws DukeException { throw new DukeException("An login requires an '/' to indicate password!"); } int atPosition = input[1].indexOf("/"); - if (input[1].substring(0, atPosition).isBlank()) { + if (input[1].substring(0, atPosition).isEmpty()) { throw new DukeException("There is no username in your login command!"); - } else if (input[1].substring(atPosition + 1).isBlank()) { + } else if (input[1].substring(atPosition + 1).isEmpty()) { throw new DukeException("An login requires a password!"); } } From 599b4187ab1dad108f99af04e17e3fc9653d12fb Mon Sep 17 00:00:00 2001 From: "SKYLER\\User" Date: Sat, 10 Oct 2020 00:35:50 +0800 Subject: [PATCH 09/14] Updated WeiSiong Feature2 --- text-ui-test/EXPECTED.TXT | 12 ++++++++---- text-ui-test/input.txt | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/text-ui-test/EXPECTED.TXT b/text-ui-test/EXPECTED.TXT index 4f92e20e6f..2b6408d66c 100644 --- a/text-ui-test/EXPECTED.TXT +++ b/text-ui-test/EXPECTED.TXT @@ -1,15 +1,19 @@ + ____________________________________________________________ - _ _ _ _____ _ _____ _ -| | | | | | __ \ | |_ _(_) -| | | | |__ ___ _ __ ___| | \/ ___ | |_| | _ _ __ ___ ___ + _ _ _ _____ _ _____ _ +| | | | | | __ \ | |_ _(_) +| | | | |__ ___ _ __ ___| | \/ ___ | |_| | _ _ __ ___ ___ | |/\| | '_ \ / _ \ '__/ _ \ | __ / _ \| __| | | | '_ ` _ \ / _ \ \ /\ / | | | __/ | | __/ |_\ \ (_) | |_| | | | | | | | | __/ \/ \/|_| |_|\___|_| \___|\____/\___/ \__\_/ |_|_| |_| |_|\___| - + Hello! Welcome to WhereGotTime! Please enter your time table details. You may refer to the User Guide for instructions. ____________________________________________________________ ____________________________________________________________ +Hello John Snow! +____________________________________________________________ +____________________________________________________________ Thanks for using WhereGotTime. Hope to see you again soon! ____________________________________________________________ diff --git a/text-ui-test/input.txt b/text-ui-test/input.txt index b023018cab..cfc58f9be8 100644 --- a/text-ui-test/input.txt +++ b/text-ui-test/input.txt @@ -1 +1,2 @@ -bye +login John Snow /123123 +bye \ No newline at end of file From 860471648984910a286927d97cb20d143a3f120b Mon Sep 17 00:00:00 2001 From: "SKYLER\\User" Date: Sat, 10 Oct 2020 00:44:26 +0800 Subject: [PATCH 10/14] Updated Weisiong feature2: Add --- text-ui-test/EXPECTED.TXT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text-ui-test/EXPECTED.TXT b/text-ui-test/EXPECTED.TXT index 2b6408d66c..d5489267c9 100644 --- a/text-ui-test/EXPECTED.TXT +++ b/text-ui-test/EXPECTED.TXT @@ -1,4 +1,3 @@ - ____________________________________________________________ _ _ _ _____ _ _____ _ | | | | | | __ \ | |_ _(_) @@ -17,3 +16,4 @@ ____________________________________________________________ ____________________________________________________________ Thanks for using WhereGotTime. Hope to see you again soon! ____________________________________________________________ + From dd959e683c272b24ebc6ce5484b3e85bf2db602f Mon Sep 17 00:00:00 2001 From: "SKYLER\\User" Date: Sat, 10 Oct 2020 01:20:40 +0800 Subject: [PATCH 11/14] Updated weisiongFeatue2:Add --- src/main/java/seedu/duke/command/LogInCommand.java | 3 +-- text-ui-test/EXPECTED.TXT | 11 +++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/seedu/duke/command/LogInCommand.java b/src/main/java/seedu/duke/command/LogInCommand.java index 86140e996d..463cecfa6c 100644 --- a/src/main/java/seedu/duke/command/LogInCommand.java +++ b/src/main/java/seedu/duke/command/LogInCommand.java @@ -26,8 +26,7 @@ public void execute(UserList users, Ui ui, User nowUser/*, Storage storage*/) th ui.greetUser(newUser); isLogIn = true; - System.out.println(users.getTotalUserCount()); - System.out.println(users.getUser(1).getName()); + //storage.write(tasks); } } diff --git a/text-ui-test/EXPECTED.TXT b/text-ui-test/EXPECTED.TXT index d5489267c9..8ea1fdd4cc 100644 --- a/text-ui-test/EXPECTED.TXT +++ b/text-ui-test/EXPECTED.TXT @@ -1,11 +1,11 @@ ____________________________________________________________ - _ _ _ _____ _ _____ _ -| | | | | | __ \ | |_ _(_) -| | | | |__ ___ _ __ ___| | \/ ___ | |_| | _ _ __ ___ ___ + _ _ _ _____ _ _____ _ +| | | | | | __ \ | |_ _(_) +| | | | |__ ___ _ __ ___| | \/ ___ | |_| | _ _ __ ___ ___ | |/\| | '_ \ / _ \ '__/ _ \ | __ / _ \| __| | | | '_ ` _ \ / _ \ \ /\ / | | | __/ | | __/ |_\ \ (_) | |_| | | | | | | | | __/ \/ \/|_| |_|\___|_| \___|\____/\___/ \__\_/ |_|_| |_| |_|\___| - + Hello! Welcome to WhereGotTime! Please enter your time table details. You may refer to the User Guide for instructions. @@ -15,5 +15,4 @@ Hello John Snow! ____________________________________________________________ ____________________________________________________________ Thanks for using WhereGotTime. Hope to see you again soon! -____________________________________________________________ - +____________________________________________________________ \ No newline at end of file From a1e5cd36962326ff2c2a260954e3bd40280e1272 Mon Sep 17 00:00:00 2001 From: "SKYLER\\User" Date: Sat, 10 Oct 2020 01:54:05 +0800 Subject: [PATCH 12/14] Updated Weisiong Feature2:Add --- text-ui-test/input.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/text-ui-test/input.txt b/text-ui-test/input.txt index 522ffede78..cfc58f9be8 100644 --- a/text-ui-test/input.txt +++ b/text-ui-test/input.txt @@ -1,3 +1,2 @@ login John Snow /123123 -bye - +bye \ No newline at end of file From 2e6e90baa2dc59e7c4978e7f6f8650c8f33b1ff9 Mon Sep 17 00:00:00 2001 From: "SKYLER\\User" Date: Sat, 10 Oct 2020 04:30:24 +0800 Subject: [PATCH 13/14] Updated WeisiongFeature2:add --- text-ui-test/EXPECTED.TXT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text-ui-test/EXPECTED.TXT b/text-ui-test/EXPECTED.TXT index 8ea1fdd4cc..7fadba3eb3 100644 --- a/text-ui-test/EXPECTED.TXT +++ b/text-ui-test/EXPECTED.TXT @@ -15,4 +15,4 @@ Hello John Snow! ____________________________________________________________ ____________________________________________________________ Thanks for using WhereGotTime. Hope to see you again soon! -____________________________________________________________ \ No newline at end of file +____________________________________________________________ From 3803066773a7bb2932ded856515c35e2e51f1bec Mon Sep 17 00:00:00 2001 From: "SKYLER\\User" Date: Sat, 10 Oct 2020 11:24:27 +0800 Subject: [PATCH 14/14] Updated the weisiong-Feature 2:Add Feature --- src/main/java/seedu/duke/parser/Parser.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/seedu/duke/parser/Parser.java b/src/main/java/seedu/duke/parser/Parser.java index cbae2c086b..3e0a86c7fb 100644 --- a/src/main/java/seedu/duke/parser/Parser.java +++ b/src/main/java/seedu/duke/parser/Parser.java @@ -79,9 +79,9 @@ private static void checkAddValidity(String[] input) throws DukeException { throw new DukeException("There is no day in your add command!"); } else if (position[2].isEmpty()) { throw new DukeException("There is no time in your add command!"); - } else if (position[3].isEmpty()) { + } else { throw new DukeException("There is no location in your add command!"); - } + } }