/// <summary> /// 设置知识 /// </summary> /// <param name="userId">用户编号</param> /// <param name="variable">变量名</param> /// <param name="value">变量值</param> public static void Set(string userId, string variable, string value) { //设置变量 var vari = new Variable { Name = variable, Value = value }; //变量名 //变量值 //往全局记忆表中插入 Table.Add(userId, vari); }
/// <summary> /// 构造方法 /// </summary> public Template() { //随机选项初始化 Rand = new Rand(); //设置变量初始化 SetVariable = new Variable(); //获取变量初始化 GetVariable = new Variable(); //方法集合初始化 Function = new Function(); //*号匹配符初始化 Star = new SortedList<int>(); //获取用户输入初始化 Input = -1; //初始化疑问 Questions = new List<Question>(); }