package linenux.model;

import java.time.LocalDateTime;
import java.util.ArrayList;

/**
 * Represents a task in the schedule.
 * Only taskName is a required field and cannot be an empty string.
 */
public class Task {
    private String taskName;
    private boolean isDone;
    private LocalDateTime startTime;
    private LocalDateTime endTime;
    private ArrayList<Reminder> reminders;

    /**
     * Constructor for tasks with no deadlines or predetermined time slots.
     */
    public Task(String taskName) {
        this.taskName = taskName;
        this.isDone = false;
        this.startTime = null;
        this.endTime = null;
        this.reminders = new ArrayList<Reminder>();
    }

    /**
     * Constructor for tasks with deadlines only.
     */
    public Task(String taskName, LocalDateTime endTime) {
        this.taskName = taskName;
        this.isDone = false;
        this.startTime = null;
        this.endTime = endTime;
        this.reminders = new ArrayList<Reminder>();
    }

    /**
     * Constructor for tasks with predetermined time slots.
     */
    public Task(String taskName, LocalDateTime startTime, LocalDateTime endTime) {
        this.taskName = taskName;
        this.isDone = false;
        this.startTime = startTime;
        this.endTime = endTime;
        this.reminders = new ArrayList<Reminder>();
    }

    public boolean isDone() {
        return (isDone == true);
    }

    public boolean isNotDone() {
        return (isDone == false);
    }

    @Override
    public String toString() {
        return this.taskName;
    }

    /* Getters */

    public String getTaskName() {
        return this.taskName;
    }

    public LocalDateTime getStartTime() {
        return this.startTime;
    }

    public LocalDateTime getEndTime() {
        return this.endTime;
    }

    public ArrayList<Reminder> getReminders() {
        return this.reminders;
    }

    /* Setters */

     public void setTaskName(String taskName) {
         this.taskName = taskName;
     }

     public void markAsDone() {
         this.isDone = true;
     }

     public void setStartTime(LocalDateTime startTime) {
         this.startTime = startTime;
     }

     public void setEndTime(LocalDateTime endTime) {
         this.endTime = endTime;
     }
}

@@ -408,32 +408,40 @@
 Constructor for 
+To-Dos (
 tasks with no de
@@ -467,32 +467,33 @@
 mined time slots
+)
 .%0A     */%0A    pu
@@ -726,32 +726,43 @@
 Constructor for 
+Deadlines (
 tasks with deadl
@@ -770,16 +770,17 @@
 nes only
+)
 .%0A     *
@@ -1055,16 +1055,24 @@
 tor for 
+Events (
 tasks wi
@@ -1098,16 +1098,17 @@
 me slots
+)
 .%0A     *

Reword Task constructor