From 683271cead708e24e7c31d21c25e440f43b3eacd Mon Sep 17 00:00:00 2001 From: bnjm2000 Date: Tue, 19 Sep 2023 21:56:13 +0800 Subject: [PATCH] Chore Resolved merge conflicts --- src/main/java/Chatty/Chatty.java | 6 +++--- src/main/java/Chatty/tasks/Task.java | 22 ---------------------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/src/main/java/Chatty/Chatty.java b/src/main/java/Chatty/Chatty.java index ef705b9c2..eadabf852 100644 --- a/src/main/java/Chatty/Chatty.java +++ b/src/main/java/Chatty/Chatty.java @@ -13,10 +13,10 @@ public class Chatty { public static final String LINE = "____________________________________________________________"; public static void main(String[] args) { - printWelcomeMessage(); ArrayList tasks = new ArrayList<>(); int taskCount = 0; taskCount = loadTasks(tasks, taskCount); + printWelcomeMessage(); Scanner scanner = new Scanner(System.in); String input = scanner.nextLine(); int index; @@ -92,11 +92,11 @@ private static int loadTasks(ArrayList tasks, int taskCount) { switch (type) { case "T": - tasks.set(taskCount, new Todo(description)); + tasks.add(new Todo(description)); break; case "D": String by = parts[3].trim(); - tasks.set(taskCount, new Deadline(description, by)); + tasks.add(new Deadline(description, by)); break; case "E": String fromTo = parts[3].trim(); diff --git a/src/main/java/Chatty/tasks/Task.java b/src/main/java/Chatty/tasks/Task.java index 235b62550..5b03d8adc 100644 --- a/src/main/java/Chatty/tasks/Task.java +++ b/src/main/java/Chatty/tasks/Task.java @@ -31,26 +31,4 @@ public boolean getIsDone(){ public String saveFormat() { return ""; } -} - - - - public Event(String description, String from, String to) { - super(description); - this.from = from; - this.to = to; - } - - public String getFrom() { - return from; - } - - public String getTo() { - return to; - } - - @Override - public String getDescription() { - return "[E][" + getStatusIcon() + "] " + super.getDescription() + " (from: " + from + " to: " + to + ")"; - } } \ No newline at end of file