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

[Loh Yee Kai] iP #4

Open
wants to merge 64 commits into
base: master
Choose a base branch
from

Conversation

friedrice231
Copy link

@friedrice231 friedrice231 commented Feb 3, 2025

PawPal Chatbot Overview 🐾

PawPal is a task management chatbot that enables users to organize their tasks conveniently via command-line interaction.

Key Features

  1. Command parsing and delegation
  2. Task types:
    • ToDo tasks
    • Deadlines with date and time
    • Events with a start and end time
  3. Persistent storage for task lists

Components Overview

  • Parser: Handles user command parsing.
  • Task List: Manages the tasks by adding, removing, or marking them​.
  • Storage: Loads and saves tasks to ./data/tasks.txt.
  • Printer: Provides formatted responses for user .
  • UI: Displays messages and reads user input​s.

Features:

  • Managing tasks
  • Improved UI
  • Giving PawPal more personality

Here's how you can interact with PawPal to add an event

event CS2103DE finals /from 02 May 2025 0900AM /to 02 May 2025 1100AM

Tip: Always provide a detailed description for tasks to ensure effective task management ⌚ .

Main function of PawPal:

public class PawPal {

    /**
     * The entry point of the PawPal application.
     *
     * @param args Command-line arguments (not used).
     */
    public static void main(String[] args) {
        new PawPal().run();
    }

    private final Parser parser;
    private final Storage storage;
    private final TaskList taskList;
    private final Ui ui;

    /**
     * Constructs a new PawPal.core.PawPal instance.
     * Initializes the storage, task list, UI, and parser components.
     */
    public PawPal() {
        String filePath = "./data/tasks.txt";
        this.storage = new Storage(filePath);
        this.taskList = new TaskList(storage);
        this.ui = new Ui();
        this.parser = new Parser(taskList);
    }

    /**
     * Runs the main loop of the PawPal.core.PawPal chatbot.
     * Continuously reads user input, processes commands, and prints responses.
     * The loop exits when the user enters the "bye" command.
     */
    public void run() {
        ui.showGreeting();

        // Main input loop
        while (true) {
            String input = ui.readCommand();

            // Exit the application when the user types "bye"
            if (input.equalsIgnoreCase("bye")) {
                ui.showBye();
                break;
            }

            // Pass the user input to the parser for processing
            parser.parse(input);

            try {
                storage.saveTasks(taskList.getTasks());
            } catch (IOException e) {
                ui.showSavingError();
            }
        }
    }
}

Developed from the repo here

@Pranavan135
Copy link
Member

Git commits should follow git convention and should be meaningful.

friedrice231 and others added 30 commits February 7, 2025 19:04
…fore the end date. Add an assert statement in Event Constructor to check that the parsed start time is not after the end time. This documents the assumption that an Event’s start must chronologically precede its end.
…escription' string is not blank. This documents our assumption that a valid Deadline cannot have an empty deadline string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants