package org.studiorailgun.schedule;

import java.util.LinkedList;

/**
 * An event
 */
public class Event implements Comparable<Event>{
    
    /**
     * The time when this event will happen
     */
    Time time;

    /**
     * The type of the event
     */
    String type;

    /**
     * The data of the event
     */
    LinkedList<Object> data = new LinkedList<Object>();

    /**
     * Creates an event
     * @param time The time the event occurs
     * @param type The type of the event
     * @param params The data of the event
     */
    public Event(Time time, String type, Object ... params){
        this.time = time;
        this.type = type;
        for(Object el : params){
            data.add(el);
        }
    }

    /**
     * Gets the time when the event occurs
     * @return The time
     */
    public Time getTime(){
        return time;
    }

    /**
     * Gets the type of the event
     * @return The type of the event
     */
    public String getType(){
        return type;
    }

    /**
     * Gets the data for the event
     * @return The data for the event
     */
    public LinkedList<Object> getData(){
        return data;
    }

    @Override
    public int compareTo(Event other) {
        return this.time.compareTo(other.time);
    }

}
