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