コード例 #1
0
        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);
        }
コード例 #2
0
 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;
 }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 public ExecutableStatechart(ParsedStatenode rootnode, TContext initialContext, IDictionary <StatenodeId, ParsedStatenode> statenodes) : base(rootnode)
 {
     InitialContext = initialContext;
     Statenodes     = statenodes;
 }
コード例 #6
0
 protected ParsedStatechart(ParsedStatenode rootnode) =>
コード例 #7
0
 public static Microstep InitializeStatechart(ParsedStatenode statechartRootnode) =>
 new Microstep(new InitializeStatechartEvent(), null, statechartRootnode.Yield(), Enumerable.Empty <ParsedStatenode>());
コード例 #8
0
 public bool IsInitialized(ParsedStatenode statenode)
 => Contains(statenode) && _lookup[statenode.Id].Children.Any();
コード例 #9
0
 public bool Contains(ParsedStatenode statenode)
 => _lookup.ContainsKey(statenode.Id);