private void AddTriggerEffects(IEnumerable <ProductTrigger> triggers) { foreach (var t in triggers) { foreach (var effect in t.Effects) { _effectsafter.AddEffect(t, effect); } } }
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); } } }
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; }
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; }