Esempio n. 1
0
        public MarkovNode <T> AddNext(MarkovNode <T> next)
        {
            if (Nexts.ContainsKey(next))
            {
                Nexts[next]++;
            }
            else
            {
                Nexts.Add(next, 1);
            }

            next.Occurrence++;

            return(this);
        }
Esempio n. 2
0
        public AppFunc AppFuncBuilder(AppFunc next)
        {
            ++AppFuncBuilderCallCount;

            #pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
            return(async(IDictionary <string, object> environment) => {
                Environments.Add(environment);
                Nexts.Add(next);

                Action?.Invoke();

                if (ChainToNextAppFunc)
                {
                    next(environment).Wait();
                }
            });
        }