Ejemplo n.º 1
0
        public bool Inspect <T>(BasicEventAction <T> eventAction)
            where T : StateMachine <T>
        {
            AppendEventAction(eventAction);

            return(true);
        }
Ejemplo n.º 2
0
        private void BindEventAction(int all, int i, FastProperty <T, int> property)
        {
            var e      = _sources[i];
            var eevent = BasicEvent <T> .GetEvent(e);

            var eventAction = new BasicEventAction <T>(eevent);

            int flag = 1 << i;

            eventAction.Then(x =>
            {
                int value = property.Get(x) | flag;
                property.Set(x, value);

                if (value == all)
                {
                    x.RaiseEvent(_target);
                }
            });

            _bindEventAction(eventAction);
        }