Ejemplo n.º 1
0
        public void Add(Command cmd)
        {
            lock (queueLock)
            {
                buffer.AddLast (cmd);

                while (buffer.Count > Size)
                    buffer.RemoveFirst ();
            }
        }
Ejemplo n.º 2
0
        internal void AddCommand(Command command)
        {
            buffer.Add (command);

            var evt = CommandDetected;
            if (evt != null)
                evt (command);

            var matched = buffer.FindEggs (Eggs);

            if (matched == null)
                return;

            foreach (var m in matched)
            {
                var evt2 = EggDetected;
                if (evt2 != null)
                    evt2 (m);
            }
        }