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

Merge branch-A-Personality to master #6

Merged
merged 3 commits into from
Sep 17, 2023
Merged
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
10 changes: 10 additions & 0 deletions src/main/java/corgi/commands/AddTaskCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
import java.util.Stack;

import corgi.State;
import corgi.tasks.Deadline;
import corgi.tasks.Event;
import corgi.tasks.Task;
import corgi.tasks.TaskList;
import corgi.tasks.ToDo;
import corgi.ui.TextRenderer;
import javafx.util.Pair;

Expand Down Expand Up @@ -33,6 +36,13 @@ public class AddTaskCommand extends Command {
public AddTaskCommand(Task target) {
super(false);
this.target = target;
if (target instanceof ToDo) {
this.taskType = "todo";
} else if (target instanceof Deadline) {
this.taskType = "deadline";
} else if (target instanceof Event) {
this.taskType = "event";
}
}

/**
Expand Down
32 changes: 20 additions & 12 deletions src/main/java/corgi/ui/TextRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,6 @@ public String showTaskAdded(String type, String taskInfo, int currentListSize) {
"\nNow you have " + currentListSize + " " + (currentListSize > 1 ? "tasks" : "task") + " in the list.");
}

/**
* Display a message indicating tasks have been loaded from data file.
*/
public String showTasksLoaded(int size) {
return returnMessage("Successfully loaded " + size + " tasks!");
}

/**
* Display a exit message.
*/
Expand All @@ -115,7 +108,8 @@ public String showExitMsg() {
* @param date The target date.
*/
public String showNoTaskOnDate(String date) {
return returnMessage("No tasks or events are scheduled for " + date + ".");
return returnMessage("Ugh, seriously? No tasks or events on " + date
+ "? What a waste of time.");
}

/**
Expand All @@ -125,7 +119,11 @@ public String showNoTaskOnDate(String date) {
* @param tasksOnDate The tasks occurred on the target date.
*/
public String showTasksOnDate(String date, String tasksOnDate) {
return returnMessage("Here are the tasks and events happening on " + date + ":", tasksOnDate);
return returnMessage("Fine, here's what's going on on " + date + ":",
"",
tasksOnDate,
"",
"Don't expect me to be excited about it.");
}

/**
Expand All @@ -134,7 +132,8 @@ public String showTasksOnDate(String date, String tasksOnDate) {
* @param keyword The target keyword.
*/
public String showKeywordNotFound(String keyword) {
return returnMessage("No task containing keyword \"" + keyword + "\".");
return returnMessage("No task with that annoying keyword \"" + keyword
+ "\" found. It's like searching for a bone in an empty bowl.");
}

/**
Expand All @@ -145,7 +144,8 @@ public String showKeywordNotFound(String keyword) {
*/
public String showTasksWithKeyword(String keyword, String tasksContainKeyword) {
return returnMessage(
"Here are the tasks containing keyword \"" + keyword + "\":",
"Ugh, fine, I found tasks with that ridiculous keyword \"" + keyword + "\":",
"",
tasksContainKeyword);
}

Expand Down Expand Up @@ -203,7 +203,15 @@ public String showTaskList(String taskList) {
return taskList;
}

/**
* Generates a message indicating a successful undo of the last command.
*
* @param commandDesc The description of the undone command.
* @return A string message indicating the successful undo.
*/
public String showUndoSucceed(String commandDesc) {
return returnMessage("Undo successful: " + commandDesc);
return returnMessage("Argh, fine!",
"I undid it: " + commandDesc,
"You better think twice next time!");
}
}
Loading