Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
cefd18d
Add Greet and Exit functions
Cazh1 Aug 31, 2023
a30a0be
Add Echo function
Cazh1 Aug 31, 2023
ff4554d
Add List and Add function
Cazh1 Sep 2, 2023
899542c
Add Mark-as-Done function
Cazh1 Sep 2, 2023
cd10722
Tweak the code to comply with coding standard
Cazh1 Sep 7, 2023
95c15bd
Update code logic to use Object Class
Cazh1 Sep 7, 2023
3d50f0a
Add tracking for types of tasks
Cazh1 Sep 7, 2023
c7b6dac
Update methods to use Object class
Cazh1 Sep 7, 2023
a5d5914
Update methods to use Object class
Cazh1 Sep 7, 2023
50f175c
Merge branch 'master' of https://github.com/Cazh1/ip
Cazh1 Sep 8, 2023
8e1aead
Refactor code
Cazh1 Sep 12, 2023
3dbdfbc
Add Error Handling function
Cazh1 Sep 12, 2023
544d7c9
Add Error Handling function
Cazh1 Sep 12, 2023
060f8b7
Revert "Add Error Handling function"
Cazh1 Sep 12, 2023
712e602
Merge branch 'master' into branch-Level-5
Cazh1 Sep 12, 2023
20a68c2
Merge pull request #1 from Cazh1/branch-Level-5
Cazh1 Sep 12, 2023
16e8cbf
Add Automated Text UI Testing
Cazh1 Sep 14, 2023
5cfdcb5
Update Exception Handler to cover more exceptions
Cazh1 Sep 15, 2023
8ff14d8
Organise files into Packages
Cazh1 Sep 15, 2023
335ff3f
Update Organization of Package
Cazh1 Sep 15, 2023
578c87e
Update Error handling code - clean up
Cazh1 Sep 15, 2023
ca8c8e3
Update Automated Text UI Testing
Cazh1 Sep 16, 2023
23dfdee
Update code with regards to TA comments
Cazh1 Sep 16, 2023
ee3e90e
Add Delete function
Cazh1 Sep 17, 2023
fe43edd
Add Save function
Cazh1 Sep 21, 2023
b7a4dd3
Update Saving capability
Cazh1 Sep 27, 2023
f583868
Merge pull request #2 from Cazh1/branch-Level-6
Cazh1 Sep 27, 2023
6b15613
Merge pull request #3 from Cazh1/branch-Level-7
Cazh1 Sep 27, 2023
4c2227f
Add import for Delete in main
Cazh1 Sep 27, 2023
0a23d97
Update previousList format
Cazh1 Sep 27, 2023
0e39d2e
Add MoreOOP for Storage and Command
Cazh1 Sep 27, 2023
e8b4ef4
Add MoreOOP for TextUi
Cazh1 Oct 2, 2023
32f1853
Add Find function
Cazh1 Oct 2, 2023
96ac6d1
Add Java Documentation
Cazh1 Oct 3, 2023
f41f811
Merge pull request #4 from Cazh1/branch-Level-9
Cazh1 Oct 3, 2023
b3bcec5
Merge pull request #5 from Cazh1/branch-JavaDoc
Cazh1 Oct 3, 2023
d0f4404
Update README.md
Cazh1 Oct 4, 2023
f6ef0c4
Update README.md
Cazh1 Oct 4, 2023
5d0ee0d
Update README.md
Cazh1 Oct 4, 2023
2ff6d44
Update README.md
Cazh1 Oct 4, 2023
9f93c2e
Update README.md
Cazh1 Oct 4, 2023
a077f54
Update README.md
Cazh1 Oct 4, 2023
bd265bb
Update README.md
Cazh1 Oct 4, 2023
e6b2f51
Update README.md
Cazh1 Oct 4, 2023
449b98d
Update README.md
Cazh1 Oct 4, 2023
bfdc87d
Update README.md
Cazh1 Oct 4, 2023
fb8bcff
Update README.md
Cazh1 Oct 4, 2023
f691c78
Update README.md
Cazh1 Oct 4, 2023
8f7dbd9
Update README.md
Cazh1 Oct 4, 2023
531399a
Update README.md
Cazh1 Oct 6, 2023
9b0876a
Update Code Quality
Cazh1 Oct 6, 2023
d17d6b4
Update README.md
Cazh1 Oct 6, 2023
7ee1694
Update Code Quality
Cazh1 Oct 6, 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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ bin/

/text-ui-test/ACTUAL.TXT
text-ui-test/EXPECTED-UNIX.TXT
/data/
text-ui-test/data/KenergeticBot.txt
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Duke project template
# KenergeticBot project template

This is a project template for a greenfield Java project. It's named after the Java mascot _Duke_. Given below are instructions on how to use it.

Expand All @@ -13,12 +13,10 @@ Prerequisites: JDK 11, update Intellij to the most recent version.
1. If there are any further prompts, accept the defaults.
1. Configure the project to use **JDK 11** (not other versions) as explained in [here](https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk).<br>
In the same dialog, set the **Project language level** field to the `SDK default` option.
3. After that, locate the `src/main/java/Duke.java` file, right-click it, and choose `Run Duke.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:
3. After that, locate the `src/main/java/KenergeticBot.java` file, right-click it, and choose `Run KenergeticBot.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:
```
Hello from
____ _
| _ \ _ _| | _____
| | | | | | | |/ / _ \
| |_| | |_| | < __/
|____/ \__,_|_|\_\___|
____________________________________________________________
Hello! I'm KenergeticBot
What can I do for you?
____________________________________________________________
```
131 changes: 119 additions & 12 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,136 @@
# User Guide
## Hi there! I am KenergeticBot
I am a personal Task managing chatbot, able to store tasks such as To dos, Deadlines and Events.

## Setting up in Intellij

Prerequisites: JDK 11, update Intellij to the most recent version.

1. Open Intellij (if you are not in the welcome screen, click `File` > `Close Project` to close the existing project first)
1. Open the project into Intellij as follows:
1. Click `Open`.
1. Select the project directory, and click `OK`.
1. If there are any further prompts, accept the defaults.
1. Configure the project to use **JDK 11** (not other versions) as explained in [here](https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk).<br>
In the same dialog, set the **Project language level** field to the `SDK default` option.
3. After that, locate the `src/main/java/KenergeticBot.java` file, right-click it, and choose `Run KenergeticBot.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:

____________________________________________________________
Hello! I'm KenergeticBot
What can I do for you?
____________________________________________________________


## Features

### Feature-ABC
> **Notes about command format:**
> - Words encased in `{ }` are the arguments to be supplied by user. <br>
e.g. `deadline {Description} /by {Deadline Date & Time}`, `Description` and `Deadline Date & Time` are arguments to be specified by user.
> - Parameters need to be in the exact format as specified. <br>
e.g. `event {Description} /from {Event Start Date & Time} /to {Event End Date & Time}`, `/from` must come before `/to`.
### Here are some of the things I can do!

### Task Creation

Create 3 types of Tasks:

1. Todo: Tasks which are not time sensitive.

Format: `todo {Description}`

Example: <br> `todo read book`
2. Deadline: Tasks which are time sensitive, able to indicate deadline using /by.

Format: `deadline {Description} /by {Deadline Date & Time}`

Example: <br> `deadline return book /by Sunday`
3. Event: Tasks which are happening at a specific time frame, using /from and /to.

Format: `event {Description} /from {Event Start Date & Time} /to {Event End Date & Time}`

Example: <br> `event project meeting /from Mon 2pm /to 4pm`


### Task Viewing

Lists all the task in the task list.

Format: `list`


Description of the feature.
list
____________________________________________________________
Here are the tasks in your list:
1.[T][ ] borrow book
2.[D][ ] return book (by: Sunday)
____________________________________________________________

### Feature-XYZ

Description of the feature.
### Task Marking

## Usage
Keep track of Task completion.
1. '[X]' Indicates Tasks that are completed, using mark command.
2. '[ ]' Indicates Tasks that are not completed, using unmark command.

### `Keyword` - Describe action
Format: `mark {task index}`

Describe the action and its outcome.
Example:

Example of usage:
mark 2
____________________________________________________________
Nice! I've marked this task as done:
[D][X] return book (by: Sunday)
____________________________________________________________

`keyword (optional arguments)`

Expected outcome:
Format: `unmark {task index}`

Description of the outcome.
Example:

unmark 2
____________________________________________________________
OK, I've marked this task as not done yet:
[D][ ] return book (by: Sunday)
____________________________________________________________


### Task Saving
Store and retrieve your tasks into a dedicated save file.
```
expected output
Loading previous list
Successfully wrote to the file.
```

### Task Finding

Search for keyword using the Find function.

Format: `find {keyword}`

find book
____________________________________________________________
Here are the matching tasks in your list:
1.[T][ ] borrow book
2.[D][ ] return book (by: Sunday)
____________________________________________________________


### Task Deletion

Remove stored Tasks using the Delete function.

Format: `delete {task index}`

delete 2
____________________________________________________________
Noted. I've removed this task:
[D][ ] return book (by: Sunday)
Now you have 1 tasks in the list.
____________________________________________________________


### End Program
Terminates the chatbot program.

Format: `bye`

10 changes: 0 additions & 10 deletions src/main/java/Duke.java

This file was deleted.

56 changes: 56 additions & 0 deletions src/main/java/KenergeticBot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import kenergeticbot.TaskList;
import kenergeticbot.command.Command;
import kenergeticbot.fileaccess.Storage;
import kenergeticbot.ui.TextUi;
import kenergeticbot.Parser;
import kenergeticbot.command.ExitCommand;

/**
* Entry point of the KenergeticBot chatbot.
* Initializes the application and starts the interaction with the user.
*/
public class KenergeticBot {
public static final String filePath = "data/KenergeticBot.txt";

private TextUi ui;
private Storage storage;
public TaskList taskList;

public static void main(String[] args) {
new KenergeticBot().run();
}

/**
* Sets up the required objects, loads up the data from the storage file, and prints the welcome message.
*/
private void start(String filePath, TaskList taskList, TextUi ui) {
this.storage = new Storage(filePath, ui);
storage.loadPreviousList(taskList, ui);
ui.printGreetingMessage();
}

/** Runs the program until termination. */
public void run() {
this.taskList = new TaskList();
this.ui = new TextUi();
start(filePath, taskList, ui);
runCommandLoopUntilExitCommand();
exit(ui);
}

/** Reads the user command and executes it, until the user issues the exit command. */
public void runCommandLoopUntilExitCommand() {
do {
String item = ui.getUserCommand();
Command c = Parser.parseCommand(taskList, item);
c.execute(taskList, ui);
} while (!ExitCommand.isExit());
storage.saveList(taskList, ui);
}

/** Prints the Goodbye message and exits. */
private static void exit(TextUi ui) {
ui.printExitMessage();
System.exit(0);
}
}
3 changes: 3 additions & 0 deletions src/main/java/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: KenergeticBot

Loading