public void Dispatch(object dispatchKey, object dispatchParam)
        {
            var notify = new ObserverParam(dispatchKey, dispatchParam, null);

            _gameManager.CommandMap.ExecuteCommand(notify);
            SendNotifyToObject(notify);
        }
Esempio n. 2
0
        public void Dispatch(object dispatchKey)
        {
            var notify = new ObserverParam(dispatchKey, null, null);

            CommandMap.ExecuteCommand(notify);
            SendNotifyToObject(notify);
        }
Esempio n. 3
0
        public void Dispatch(object dispatchKey, object dispatchParam, object dispatchMsg)
        {
            var notify = new ObserverParam(dispatchKey, dispatchParam, dispatchMsg);

            CommandMap.ExecuteCommand(notify);
            SendNotifyToObject(notify);
        }
        private void SendNotifyToObject(ObserverParam notify)
        {
            if (!DispatchList.ContainsKey(notify.Key))
            {
                return;
            }
            var actions = DispatchList[notify.Key];

            for (var i = 0; i < actions.Count; i++)
            {
                var tmpBehavior = actions.Values.ElementAt(i);
                tmpBehavior.OnHandlerObserver(notify, actions.Keys.ElementAt(i));
            }
        }