コード例 #1
0
        public ChatRuntime(List <Chat> theChats, IAppConfig config = null)
        {
            this.Reset(theChats);

            if (config != null)
            {
                this.actors     = config.GetActors();
                this.validators = config.GetValidators();

                var trans = config.GetTransforms();
                if (trans != null)
                {
                    foreach (var key in trans.Keys)
                    {
                        this.AddTransform(key, trans[key]);
                    }
                }

                var cmds = config.GetCommands();
                if (cmds != null)
                {
                    foreach (var cmd in cmds)
                    {
                        if (!typeMap.ContainsKey(cmd.label))
                        {
                            typeMap.Add(cmd.label, cmd.type);
                        }
                    }
                }
            }
        }