Esempio n. 1
0
        public void OnGameEvent(GameEvent gameEvent)
        {
            GameEventDescriptor gameEventDescriptor;

            if (m_GameEventDescriptors.TryGetValue(gameEvent.ID, out gameEventDescriptor))
            {
                if (gameEvent.Keys.Count != gameEventDescriptor.Keys.Count)
                {
                    Console.WriteLine("GameEvent ({0}) and GameEventDescriptor ({1}) Key Count Mismatch", gameEvent.ID, gameEventDescriptor.Name);
                }

                OnGameEvent onGameEvent;

                if (m_GameEventHandlers.TryGetValue(gameEventDescriptor.Name, out onGameEvent))
                {
                    onGameEvent(gameEvent, gameEventDescriptor);
                }

                m_Demo.GameObservers.GameEvent(gameEvent, gameEventDescriptor);

                if(!m_UsedGameEventDescriptors.Contains(gameEventDescriptor))
                {
                    m_UsedGameEventDescriptors.Add(gameEventDescriptor);
                }
            }
            else
            {
                Console.WriteLine("GameEvent ({0}) Without GameEventDescriptor", gameEvent.ID);
            }
        }
        public void GameEvent(GameEvent gameEvent, GameEventDescriptor gameEventDescriptor)
        {
            for (int i = 0; i < this.m_Values.Count; i++)
            {
                GameObserver gameObserver = this.m_Values[i];

                gameObserver.GameEvent(gameEvent, gameEventDescriptor);
            }
        }
Esempio n. 3
0
        private void GameEvent(byte[] packetBuffer)
        {
            GameEvent gameEvent = new GameEvent(packetBuffer);

            m_Demo.GameEventHandlers.OnGameEvent(gameEvent);
        }