Skip to content
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

[Luah Jun Yang} iP #571

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
28ad2b8
Add Gradle support
May 24, 2020
ed6d4d2
Bump gradle and lib version
Eclipse-Dominator Aug 5, 2023
8f211eb
Level 0
LuahJunYang Aug 26, 2023
c442a23
Finished Level 1, renamed bot to Frenchie
LuahJunYang Aug 26, 2023
e26ad60
Added functionality to store user input as list and print out all inp…
LuahJunYang Aug 28, 2023
2826c8b
Created Task class to be used for Frenchie
LuahJunYang Aug 28, 2023
c163e3f
Added addTask and listTask methods and a constructor to Frenchie.java
LuahJunYang Aug 30, 2023
6880516
Added mark as incomplete method to Task.java and complete and uncompl…
LuahJunYang Aug 30, 2023
9502380
Created new Task subclasses
LuahJunYang Aug 30, 2023
6403c3d
Added if-else statements and updated toString() methods for checking…
LuahJunYang Aug 30, 2023
f8faf33
Created new FrenchieException class to handle basic exceptions for no…
LuahJunYang Sep 4, 2023
59151ce
Added delete function to frenchie, changed tasks attribute to ArrayLi…
LuahJunYang Sep 4, 2023
76c74cf
Added functions saveTasksToFile and readTasksFromFile
LuahJunYang Sep 9, 2023
efa2cac
Added LocalDateTime and DateTimeFormatter functionalities to construc…
LuahJunYang Sep 10, 2023
cf2306e
Implemented enum for Commands, abstracted UI, Parser, Storage, and Ta…
LuahJunYang Sep 17, 2023
3a10e8d
Bug fixing for bye command, causing an illegal state exception when t…
LuahJunYang Sep 17, 2023
c59c708
Packaged all classes into package.frenchie
LuahJunYang Sep 18, 2023
1435a48
Merge branch 'add-gradle-support' for 'A-Gradle'
LuahJunYang Sep 18, 2023
fb9f638
Updated build.gradle file, wrote J-unit tests ToDoTest and TaskTest
LuahJunYang Sep 21, 2023
2ac3943
Added JavaDoc comments for Task, ToDo, Deadline, Event, Ui, Parser cl…
LuahJunYang Sep 21, 2023
e8b0d86
Added findMessage() method to Ui.java, find enum to Command, and retu…
LuahJunYang Sep 21, 2023
eae69dd
Resolved merge conflict in Ui.java
LuahJunYang Sep 21, 2023
04310fd
Edited void functions to return String for the GUI. Implemented GUI s…
LuahJunYang Sep 22, 2023
68fc1cb
Improving on Code Quality
LuahJunYang Sep 22, 2023
4364715
Merge pull request #3 from LuahJunYang/branch-A-CodeQuality
LuahJunYang Sep 22, 2023
c59a6cf
Add help function
LuahJunYang Sep 22, 2023
43a2dd1
Merge pull request #4 from LuahJunYang/branch-C-Help
LuahJunYang Sep 22, 2023
4806d6d
Added User Guide in README.md
LuahJunYang Sep 23, 2023
8633cba
Updating README for github page
LuahJunYang Sep 23, 2023
3f79e97
Added Screenshot of UI
LuahJunYang Sep 23, 2023
7b1615e
Updated mainClass in build.gradle to fix the jar file not running
LuahJunYang Sep 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/main/java/Frenchie.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Frenchie {
public List<Task> tasks;
public ArrayList<Task> tasks;

//constructor
public Frenchie() {
Expand Down Expand Up @@ -34,6 +33,9 @@ public int getNumOfTasks() {
return this.tasks.size();
}

public void deleteTask(int index) {
tasks.remove(index);
}
public static void main(String[] args) {
/*String logo = " ____ _ \n"
+ "| _ \\ _ _| | _____ \n"
Expand Down Expand Up @@ -79,6 +81,16 @@ public static void main(String[] args) {
target_task.toString() + "\n" +
"____________________________________________________________");
}
} else if (input.contains("delete")){
String[] parts = input.split(" ");
int index = Integer.parseInt(parts[1]) - 1;
Task target_task = frenchie.tasks.get(index);
frenchie.deleteTask(index);
System.out.println("____________________________________________________________\n" +
"Noted. I've removed this task: \n" +
target_task.toString() + "\n" +
"Now you have " + frenchie.getNumOfTasks() + " tasks in the list.\n" +
"____________________________________________________________");

Choose a reason for hiding this comment

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

As the number of keywords increase, perhaps you might want to start looking at enums to have a collection of your keywords!

Copy link

Choose a reason for hiding this comment

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

Seconded. In addition, perhaps you may wish to divide all the logic in your main method into several other methods, as the complexity of your program increases.

} else if (input.contains("event") || input.contains("todo") || input.contains("deadline")) {
String[] parts = input.split(" ");
String taskType = parts[0];
Expand Down