package seedu.taskman.model.event;

import seedu.taskman.model.tag.UniqueTagList;

import java.util.Optional;

/**
 * Wrapper for both ReadOnlyEvent and ReadOnlyTask
 *
 * May i
 */
public class Activity{

    public enum ActivityType {EVENT, TASK};

    private ReadOnlyEvent activity;
    private ActivityType type;

    public Activity(ReadOnlyEvent event){
        activity = event;
        type = ActivityType.EVENT;
    }

    public Activity(ReadOnlyTask task){
        activity = task;
        type = ActivityType.TASK;
    }

    public ActivityType getType(){
        return type;
    }

    public Optional<Status> getStatus() {
        switch(type){
            case TASK:
                return Optional.ofNullable(((ReadOnlyTask)activity).getStatus());
            case EVENT:
            default:
                return null;
        }
    }

    public Optional<Deadline> getDeadline() {
        switch(type){
            case TASK:
                return ((ReadOnlyTask)activity).getDeadline();
            case EVENT:
            default:
                return Optional.empty();
        }
    }


    public Title getTitle() {
        return activity.getTitle();
    }

    public Optional<Frequency> getFrequency() {
        return activity.getFrequency();
    }

    public Optional<Schedule> getSchedule() {
        return activity.getSchedule();
    }

    public UniqueTagList getTags() {
        return activity.getTags();
    }

}

@@ -163,20 +163,8 @@
 ask%0A
- *%0A * May i%0A
  */%0A
@@ -184,16 +184,41 @@
 Activity
+ implements ReadOnlyEvent
 %7B%0A%0A    p
@@ -1121,17 +1121,30 @@
 %0A    %7D%0A%0A
+    @Override
 %0A
-
     publ
@@ -1200,32 +1200,46 @@
 Title();%0A    %7D%0A%0A
+    @Override%0A
     public Optio
@@ -1309,32 +1309,46 @@
 uency();%0A    %7D%0A%0A
+    @Override%0A
     public Optio
@@ -1415,32 +1415,46 @@
 edule();%0A    %7D%0A%0A
+    @Override%0A
     public Uniqu
@@ -1470,24 +1470,24 @@
 getTags() %7B%0A
-
         retu
@@ -1516,10 +1516,329 @@
 %0A    %7D%0A%0A
+    @Override%0A    public boolean isSameStateAs(ReadOnlyEvent other) %7B%0A        return activity.isSameStateAs(other);%0A    %7D%0A%0A    public boolean isSameStateAs(ReadOnlyTask task) %7B%0A        return task.isSameStateAs(activity);%0A    %7D%0A%0A    @Override%0A    public String getAsText() %7B%0A        return activity.getAsText();%0A    %7D%0A%0A
 %7D%0A

Make Activity implement ReadOnlyEvent