Ejemplo n.º 1
0
        public ZGamePipeArgs(ZGameEvent eventEnum, string rawEvent, ZGameState[] stateEnums, string rawState)
        {
            Event  = eventEnum;
            States = stateEnums;

            RawEvent = rawEvent;
            RawState = rawState;

            RawFullMessage = $"{rawEvent} {rawState}";
        }
Ejemplo n.º 2
0
        private void _onMessage(ZGameEvent eventEnum, string rawEvent, ZGameState[] stateEnums, string rawState)
        {
            if (StateChanged == null)
            {
                return;
            }

            // raise event
            var invocationList = StateChanged.GetInvocationList();
            var eventArgs      = new ZGamePipeArgs(eventEnum, rawEvent, stateEnums, rawState);

            foreach (var handler in invocationList)
            {
                var eventHandler = (EventHandler <ZGamePipeArgs>)handler;
                eventHandler.BeginInvoke(this, eventArgs, _EndAsyncEvent, null);
            }
        }