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

[Yao Chenguang] iP #182

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
177 changes: 165 additions & 12 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,182 @@
# User Guide

## Features
## Feature List
1. Add Tasks
Users can add various types of tasks such as to-do, deadline, and event tasks to the task list.
Command: `add`
2. View Task List
Users can view all tasks currently in the task list.
Command: `list`
3. Mark Task as Done
Users can mark a task as done.
Command: `mark`
4. Mark Task as Undone
Users can mark a completed task as not done.
Command: `unmark`
5. Delete Task
Users can delete a task from the task list.
Command: `delete`
6. Clear Task List
Users can clear all tasks from the task list.
Command: `clear`
7. Search Tasks
Users can search for tasks containing specific keywords.
Command: `find`
8. Save Task List
Users can save the current task list to a file.
Command: `save`
9. Help
Users can view a list of supported commands for using the task manager.
Command: `help`
10. Quit Task Manager
Users can exit the task manager application.
Command: `quit`

### Feature-ABC

Description of the feature.

### Feature-XYZ

Description of the feature.
## Commands

## Usage
### `list` - enter the list mode
Example of usage:

### `Keyword` - Describe action
```
list
```

Expected outcome:
```
---------------------------------------------
Here are your current tasks in your list:

---------------------------------------------
```
### `Bye` - Quit the Qchat bot

### list mode commads :

### `add` - Add a task

Adds a new task to the to-do list.

Example of usage:

```
add
todo go to class
```
Expected outcome:
```
---------------------------------------------
Here are your current tasks in your list:
1. [T][ ] go to class
---------------------------------------------
```


### `clear` - Clear all tasks

Example of usage:

```
clear
```
Expected outcome:
```
list cleared
```

### `list` - list all current tasks

Example of usage:

```
list
```
Expected outcome:
```
---------------------------------------------
Here are your current tasks in your list:
---------------------------------------------
```
### `save` - save current tasks into a file

Example of usage:

```
save
```
Expected outcome:
```
File exists, overwriting file
```

Describe the action and its outcome.

Example of usage:
### `mark & unmark` - set a task as done or not done

`keyword (optional arguments)`
Example of usage:

```
mark
1
```
Expected outcome:
```
I've marked this task as done:[T][x] go to class
```

Description of the outcome.
### `quit` - quit list mode

Example of usage:

```
quit
```
Expected outcome:
```
Task change complete
```
### `help` - get help of other commands

Example of usage:

```
help
```
Expected outcome:
```
expected output
supported commands: add , quit , help , mark, unmark ,clear, list, delete, find ,save
```

### `find` - find task which contains a given keyword

Example of usage:

```
find
class
```
Expected outcome:
```
---------------------------------------------
Here are the matching tasks in your list:
1. [T][x] go to class
---------------------------------------------
```

### `delete` - delete a task in the list

Example of usage:

```
delete
1
```
Expected outcome:
```
---------------------------------------------
Here are your current tasks in your list:
---------------------------------------------

```

Binary file added ip.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1|D|| | stellaris(by:Mar 01 2024)

41 changes: 41 additions & 0 deletions src/main/java/Deadline.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* The {@code Deadline} class represents a deadline item.
* comparing with todo , it has a end time
*
*/
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Locale;

public class Deadline extends Todo{
LocalDate endtime;
String Icon="D";
/**
* Constructs a new deadline item.
*
* @param isDone Indicates whether the deadline item is done
* @param description The description of the deadline item
* @param endtime A String indicating the end time of this deadline
*/
public Deadline(boolean isDone, String description, LocalDate endtime) {
super(isDone, description);
this.endtime = endtime;
}

/**
* similar to the one in Todo class
* @return The string representation of the to-do item
*/
@Override
public String toString(){
String DoneIcon = isDone? "x":" ";
return "["+Icon+"]"+"["+DoneIcon+"] "+ description + "(by:"+ formatDate(endtime)+")";
}

public static String formatDate(LocalDate date) {

DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MMM dd yyyy", Locale.ENGLISH);
return date.format(formatter);
}

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

This file was deleted.

32 changes: 32 additions & 0 deletions src/main/java/Event.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* The {@code Event} class represents a event item.
* it has a start time and an end time
*
*/
import java.time.LocalDate;
public class Event extends Deadline{
LocalDate starttime;
String Icon="E";
/**
* Constructs a new event item.
*
* @param isDone Indicates whether the deadline item is done
* @param description The description of the deadline item
* @param endtime A String indicating the end time of this event
* @param starttime A String indicating the start time of this event
*/
public Event(boolean isDone, String description, LocalDate endtime, LocalDate starttime) {

super(isDone, description, endtime);
this.starttime = starttime;
}
/**
* similar to the one in Todo class
* @return The string representation of the event item
*/
@Override
public String toString(){
String DoneIcon = this.isDone? "x":" ";
return "["+Icon+"]"+"["+DoneIcon+"]"+ " "+ this.description + "(from: "+formatDate(starttime)+ ") (to: "+formatDate(this.endtime)+")" ;
}
}
2 changes: 2 additions & 0 deletions src/main/java/InvalidTimeForm.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
public class InvalidTimeForm extends Exception {
}
Loading