Exemple #1
0
        internal static RuntimeContext Update(ChatScheduler sc)
        {
            if (instance == null)
            {
                instance = new RuntimeContext();
            }

            instance.Chat          = sc.chat;
            instance.NextEventTime = sc.nextEventTime;
            instance.State         = GetState(sc.chat, sc.nextEventTime);

            return(instance);
        }
Exemple #2
0
        /// <summary>
        /// Clear all chats and reset the runtime state
        /// </summary>
        public void Reset(List <Chat> theChats = null)
        {
            this.resolver    = new Resolver(this);
            this.parser      = new ChatParser(this);
            this.search      = new FuzzySearch(this);
            this.scheduler   = new ChatScheduler(this);
            this.appEvents   = new AppEventHandler(this);
            this.chatEvents  = new ChatEventHandler(this);
            this.chats       = new Dictionary <string, Chat>();
            this.choiceCache = new Dictionary <string, Choice>();

            if (!theChats.IsNullOrEmpty())
            {
                AppendChats(theChats);
            }
        }
Exemple #3
0
 internal ChatEventHandler(ChatRuntime rt)
 {
     this.runtime   = rt;
     this.scheduler = rt.scheduler;
 }