package ch.zhaw.gartenverwaltung.bootstrap;

import javafx.event.Event;
import javafx.event.EventType;

/**
 * Represents an event that should lead to a view being changed.
 */
public class ChangeViewEvent extends Event {
    private final String view;

    public static final EventType<ChangeViewEvent> CHANGE_MAIN_VIEW = new EventType<>("CHANGE_MAIN_VIEW");

    /**
     * Creates an Event that should lead to the main view being changed.
     *
     * @param eventType The {@link EventType<ChangeViewEvent>} specifying which view should be changed.
     * @param view The filename of the View to be changed to
     */
    public ChangeViewEvent(EventType<? extends Event> eventType, String view) {
        super(eventType);
        this.view = view;
    }

    public String view() {
        return view;
    }
}
