package de.accso.flexinale.common.api.eventbus;

import de.accso.flexinale.common.api.event.Event;

@SuppressWarnings("unused") // methods are called via reflection
public interface EventSubscriber<E1 extends Event> {

    String getName();
    String getGroupName();

    void receive(E1 event);

    interface EventSubscriber2<E1 extends Event, E2 extends Event>
            extends EventSubscriber<E1> {
        void receive2(E2 event);
    }

    interface EventSubscriber3<E1 extends Event, E2 extends Event, E3 extends Event>
            extends EventSubscriber2<E1, E2> {
        void receive3(E3 event);
    }

    interface EventSubscriber4<E1 extends Event, E2 extends Event, E3 extends Event, E4 extends Event>
            extends EventSubscriber3<E1, E2, E3> {
        void receive4(E4 event);
    }

    interface EventSubscriber5<E1 extends Event, E2 extends Event, E3 extends Event, E4 extends Event,
            E5 extends Event>
            extends EventSubscriber4<E1, E2, E3, E4> {
        void receive5(E5 event);
    }

    interface EventSubscriber6<E1 extends Event, E2 extends Event, E3 extends Event, E4 extends Event,
            E5 extends Event, E6 extends Event>
            extends EventSubscriber5<E1, E2, E3, E4, E5> {
        void receive6(E6 event);
    }

    interface EventSubscriber7<E1 extends Event, E2 extends Event, E3 extends Event, E4 extends Event,
            E5 extends Event, E6 extends Event, E7 extends Event>
            extends EventSubscriber6<E1, E2, E3, E4, E5, E6> {
        void receive7(E7 event);
    }

    interface EventSubscriber8<E1 extends Event, E2 extends Event, E3 extends Event, E4 extends Event,
            E5 extends Event, E6 extends Event, E7 extends Event, E8 extends Event>
            extends EventSubscriber7<E1, E2, E3, E4, E5, E6, E7> {
        void receive8(E8 event);
    }

    interface EventSubscriber9<E1 extends Event, E2 extends Event, E3 extends Event, E4 extends Event,
            E5 extends Event, E6 extends Event, E7 extends Event, E8 extends Event, E9 extends Event>
            extends EventSubscriber8<E1, E2, E3, E4, E5, E6, E7, E8> {
        void receive9(E9 event);
    }

    String RECEIVE  = "receive";
    String RECEIVE2 = "receive2";
    String RECEIVE3 = "receive3";
    String RECEIVE4 = "receive4";
    String RECEIVE5 = "receive5";
    String RECEIVE6 = "receive6";
    String RECEIVE7 = "receive7";
    String RECEIVE8 = "receive8";
    String RECEIVE9 = "receive9";
}
