internal void SetValue(StateProperty2 property, string p) { if (property != null) { _storedValues[property] = p; } }
internal string Get(StateProperty2 property) { string result; _storedValues.TryGetValue(property, out result); return(result); }
internal StateGraphBuilder DefaultForward(StateGraphBuilder nextState, StateProperty2 inputProperty = null) { DefaultTrigger = new Trigger(nextState, (c) => { c.SetValue(inputProperty, c.Input); c.CurrentOutput = c.PreviousOutput; }); return(this); }
internal StateGraphBuilder YesNoEdge(StateGraphBuilder nextState, StateProperty2 property) { addEdge("yes", nextState, (c) => c.SetValue(property, StateProperty2.TrueValue)); addEdge("of course", nextState, (c) => c.SetValue(property, StateProperty2.TrueValue)); addEdge("yeah", nextState, (c) => c.SetValue(property, StateProperty2.TrueValue)); addEdge("y", nextState, (c) => c.SetValue(property, StateProperty2.TrueValue)); addEdge("no", nextState, (c) => c.SetValue(property, StateProperty2.FalseValue)); addEdge("not", nextState, (c) => c.SetValue(property, StateProperty2.FalseValue)); addEdge("none", nextState, (c) => c.SetValue(property, StateProperty2.FalseValue)); addEdge("n", nextState, (c) => c.SetValue(property, StateProperty2.FalseValue)); return(this); }
internal StateGraphBuilder IsEdge(StateGraphBuilder stateGraphBuilder, StateProperty2 stateProperty) { this .Edge("*", stateGraphBuilder, stateProperty) .Edge("his name is *", stateGraphBuilder, stateProperty) .Edge("her name is *", stateGraphBuilder, stateProperty) .Edge("he is *", stateGraphBuilder, stateProperty) .Edge("she is *", stateGraphBuilder, stateProperty) .Edge("it is *", stateGraphBuilder, stateProperty) .Edge("correct answer is *", stateGraphBuilder, stateProperty) .Edge("* is the correct answer", stateGraphBuilder, stateProperty); return(this); }
internal StateGraphBuilder HasMatch(UtteranceMapping <ActionBlock> group, StateGraphBuilder nextState, StateProperty2 inputProperty = null) { var trigger = new Trigger(nextState, (c) => c.SetValue(inputProperty, c.Input)); _externalTriggers.Add(group, trigger); return(this); }
internal StateGraphBuilder Default(StateGraphBuilder nextState, StateProperty2 inputProperty = null) { DefaultTrigger = new Trigger(nextState, (c) => c.SetValue(inputProperty, c.Input)); return(this); }
internal void Remove(StateProperty2 property) { _storedValues.Remove(property); }
internal bool IsSet(StateProperty2 property) { return(_storedValues.ContainsKey(property)); }
internal bool IsTrue(StateProperty2 property) { return(Get(property) == StateProperty2.TrueValue); }