Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
 internal EventHandler(EventCodes eventCode, Action <TEvent> action)
 {
     this.eventCode = eventCode;
     this.action    = action;
 }
Example #4
0
 internal EventPacket(EventCodes eventCode, Dictionary <byte, object> parameters)
 {
     EventCode  = eventCode;
     Parameters = parameters;
 }