コード例 #1
0
 internal void SetValue(StateProperty2 property, string p)
 {
     if (property != null)
     {
         _storedValues[property] = p;
     }
 }
コード例 #2
0
        internal string Get(StateProperty2 property)
        {
            string result;

            _storedValues.TryGetValue(property, out result);

            return(result);
        }
コード例 #3
0
 internal StateGraphBuilder DefaultForward(StateGraphBuilder nextState, StateProperty2 inputProperty = null)
 {
     DefaultTrigger = new Trigger(nextState, (c) =>
     {
         c.SetValue(inputProperty, c.Input);
         c.CurrentOutput = c.PreviousOutput;
     });
     return(this);
 }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
 internal StateGraphBuilder Default(StateGraphBuilder nextState, StateProperty2 inputProperty = null)
 {
     DefaultTrigger = new Trigger(nextState, (c) => c.SetValue(inputProperty, c.Input));
     return(this);
 }
コード例 #8
0
 internal void Remove(StateProperty2 property)
 {
     _storedValues.Remove(property);
 }
コード例 #9
0
 internal bool IsSet(StateProperty2 property)
 {
     return(_storedValues.ContainsKey(property));
 }
コード例 #10
0
 internal bool IsTrue(StateProperty2 property)
 {
     return(Get(property) == StateProperty2.TrueValue);
 }