Пример #1
0
 private void AddTriggerEffects(IEnumerable <ProductTrigger> triggers)
 {
     foreach (var t in triggers)
     {
         foreach (var effect in t.Effects)
         {
             _effectsafter.AddEffect(t, effect);
         }
     }
 }
Пример #2
0
 private void AddEffects(EffectsCollection effects, IEnumerable <Entry> list)
 {
     foreach (var entry in list)
     {
         foreach (var effect in entry.Context.Effects)
         {
             effects.AddEffect(effect, entry, entry.Context);
         }
     }
 }
Пример #3
0
        public void CalculateEffects()
        {
            _tset = new TransitionSet();

            // overall precondition for the event
            var c = new TriggerTermCollection <bool>(true);

            foreach (var t in Triggers)
            {
                c.Add(t);

                // add to event wide transition set
                _tset.AddRange(t.Transitions);
            }

            var guards = new GuardCollection();
            var before = new EffectsCollection();
            var after  = new EffectsCollection();

            foreach (var t in Triggers)
            {
                foreach (var g in t.Guards)
                {
                    guards.AddGuard(t, g);
                }

                foreach (var effect in t.Effects)
                {
                    after.AddEffect(t, effect);
                }
            }

            guards.AddLeaveEffects(before);
            guards.AddEnterEffects(after);

            // make results visible
            EffectsBefore = before;
            EffectsAfter  = after;
            PreCondition  = c.PreCondition;
        }
Пример #4
0
        public void CalculateEffects()
        {
            _tset = new TransitionSet();

            // overall precondition for the event
            var c = new TriggerTermCollection<bool>(true);

            foreach (var t in Triggers)
            {
                c.Add(t);

                // add to event wide transition set
                _tset.AddRange(t.Transitions);
            }

            var guards = new GuardCollection();
            var before = new EffectsCollection();
            var after = new EffectsCollection();

            foreach (var t in Triggers)
            {
                foreach (var g in t.Guards)
                {
                    guards.AddGuard(t, g);
                }

                foreach (var effect in t.Effects)
                {
                    after.AddEffect(t, effect);
                }
            }

            guards.AddLeaveEffects(before);
            guards.AddEnterEffects(after);

            // make results visible
            EffectsBefore = before;
            EffectsAfter = after;
            PreCondition = c.PreCondition;
        }