package cs451.net.handler;

import cs451.net.NetManager;
import cs451.net.event.NetEvent;
import cs451.net.event.NetEventType;

/**
 * NetEventHandler for DEFAULT
 *
 * Generates errors (No event should land here...)
 *
 * @author C. Hölzl
 */
public class NetHandlerDFLT extends NetEventHandlerAbstract {

    public NetHandlerDFLT(Class<? extends NetEventHandlerAbstract> deliverLayer, Class<? extends NetEventHandlerAbstract> broadcastLayer) {
        super(deliverLayer,broadcastLayer);
    }

    @Override
    public void broadcast(NetEvent ne){
        NetManager.error(NetEventType.BCST,new Exception("Default Handler"));
    }

    @Override
    public void deliver(NetEvent ne){
        NetManager.error(NetEventType.DLVR,new Exception("Default Handler"));
    }

    @Override
    public void crash(NetEvent ne){
        NetManager.error(NetEventType.CRSH,new Exception("Default Handler"));
    }

}
