package com.jscape.util.fsm;

/**
 * @author Alex Usun
 */
public abstract class State
        implements Event.HandlerBase {

    public static final State NULL = new State() {
        @Override
        public void onEvent(Event event, EventSource eventSource)
                throws FSMException {
            // empty
        }
    };

    @SuppressWarnings("unchecked")
    public void onEvent(Event event, EventSource eventSource)
            throws FSMException {
        event.accept(this, eventSource);
    }

}
