コード例 #1
0
 internal static Transition GetInitialTransition(this ParsedOrthogonalStatenode statenode) =>
 new Transition(new InitializeEvent(statenode.Id), statenode, statenode.Statenodes, Actionblock.Empty(), Option.None <Guard>(), false);
コード例 #2
0
 private static Transition Convert(this TransitionDefinition definition, ParsedStatenode source, Func <OneOf <StatenodeId, string>, ParsedStatenode> getStatenode, ServiceDefinition serviceDefinition, int serviceIndex) =>
 definition.Match(
     forbidden => new Transition(forbidden.Event, source, Enumerable.Empty <ParsedStatenode>(), Actionblock.Empty(), Option.None <Guard>(), true),
     unguarded => new Transition(unguarded.Event.Convert(source, serviceDefinition, serviceIndex), source, unguarded.Targets.GetTargetStatenodes(source.Id, getStatenode), unguarded.Actions.Convert(), Option.None <Guard>(), false),
     unguarded => new Transition(unguarded.Event.Convert(source, serviceDefinition, serviceIndex), source, unguarded.Targets.GetTargetStatenodes(source.Id, getStatenode), unguarded.Actions.Convert(), Option.None <Guard>(), false),
     unguarded => new Transition(unguarded.Event.Convert(source, serviceDefinition, serviceIndex), source, unguarded.Targets.GetTargetStatenodes(source.Id, getStatenode), unguarded.Actions.Convert(), Option.None <Guard>(), false),
     guarded => new Transition(guarded.Event.Convert(source, serviceDefinition, serviceIndex), source, guarded.Targets.GetTargetStatenodes(source.Id, getStatenode), guarded.Actions.Convert(), (guarded.Guard as Guard).ToOption(), false),
     guarded => new Transition(guarded.Event.Convert(source, serviceDefinition, serviceIndex), source, guarded.Targets.GetTargetStatenodes(source.Id, getStatenode), guarded.Actions.Convert(), guarded.Guard.AsBase().ToOption(), false),
     guarded => new Transition(guarded.Event.Convert(source, serviceDefinition, serviceIndex), source, guarded.Targets.GetTargetStatenodes(source.Id, getStatenode), guarded.Actions.Convert(), guarded.Guard.AsBase().ToOption(), false));
コード例 #3
0
 private static Actionblock NullsafeConvert(IEnumerable <ExecutableAction> actions) =>
 actions != null
         ? Actionblock.From(actions)
         : Actionblock.Empty();