internal void Remove(ParsedStatenode statenode) { var entry = new Entry(statenode.Id, statenode.Name); statenode.Parent.Switch( parent => _lookup[parent.Id].Children.Remove(entry), () => _root = null); _lookup.Remove(statenode.Id); }
internal Transition(IEvent @event, ParsedStatenode source, IEnumerable <ParsedStatenode> targets, Actionblock actions, Option <Guard> guard, bool isForbidden) { Event = @event; Source = source; Targets = targets; Actions = actions; Guard = guard; IsForbidden = isForbidden; }
internal void Add(ParsedStatenode statenode) { var entry = new Entry(statenode.Id, statenode.Name); statenode.Parent.Switch( parent => _lookup[parent.Id].Children.Add(entry), () => _root = entry); _lookup.Add(statenode.Id, entry); }
protected ParsedStatenode( ParsedStatenode parent, string name, Option <string> uniqueIdentifier, int documentIndex, Actionblock entryActions, Actionblock exitActions) { Parent = parent.ToOption(); Name = name; UniqueIdentifier = uniqueIdentifier; DocumentIndex = documentIndex; EntryActions = entryActions; ExitActions = exitActions; Id = new StatenodeId(Parent, name); Depth = Parent.Map(p => p.Depth + 1).ValueOr(0); }
public ExecutableStatechart(ParsedStatenode rootnode, TContext initialContext, IDictionary <StatenodeId, ParsedStatenode> statenodes) : base(rootnode) { InitialContext = initialContext; Statenodes = statenodes; }
protected ParsedStatechart(ParsedStatenode rootnode) =>
public static Microstep InitializeStatechart(ParsedStatenode statechartRootnode) => new Microstep(new InitializeStatechartEvent(), null, statechartRootnode.Yield(), Enumerable.Empty <ParsedStatenode>());
public bool IsInitialized(ParsedStatenode statenode) => Contains(statenode) && _lookup[statenode.Id].Children.Any();
public bool Contains(ParsedStatenode statenode) => _lookup.ContainsKey(statenode.Id);