protected override void OnEvent(byte Code, Dictionary <byte, object> Parameters) { if (Code == 2) { Parameters.Add(252, (short)EventCodes.Move); } EventCodes eventCode = ParseEventCode(Parameters); var eventPacket = new EventPacket(eventCode, Parameters); FirstHandler?.Handle(eventPacket); }
public static AlbionParser AddEventHandler <TEvent>(this AlbionParser albionParser, EventCodes eventCode, Action <TEvent> action) where TEvent : BaseEvent { var handler = new EventHandler <TEvent>(eventCode, action); albionParser.AddHandler(handler); return(albionParser); }
internal EventHandler(EventCodes eventCode, Action <TEvent> action) { this.eventCode = eventCode; this.action = action; }
internal EventPacket(EventCodes eventCode, Dictionary <byte, object> parameters) { EventCode = eventCode; Parameters = parameters; }