package szakdolgozat.client.servereventlistener;

import szakdolgozat.client.serverevents.GameProposalEvent;
import szakdolgozat.client.serverevents.UserLoginEvent;
import szakdolgozat.client.serverevents.UserLogoutEvent;
import de.novanic.eventservice.client.event.Event;
import de.novanic.eventservice.client.event.listener.RemoteEventListener;

public abstract class ServerEventsListener implements RemoteEventListener {

	@Override
	public void apply(Event anEvent) {
		if (anEvent instanceof GameProposalEvent) {
			onGameProposal((GameProposalEvent) anEvent);
		} else if (anEvent instanceof UserLogoutEvent) {
			onUserLogout((UserLogoutEvent) anEvent);
		}else if (anEvent instanceof UserLoginEvent) {
			onUserLogin((UserLoginEvent) anEvent);
		}

	}	

	public abstract void onUserLogin(UserLoginEvent event);

	public abstract void onUserLogout(UserLogoutEvent event);

	public abstract void onGameProposal(GameProposalEvent event);

}
