Beispiel #1
0
        public NodeBuilder MakeNode(string question, Answer answer = Answer.Yes)
        {
            var node = new DialogTreeBuilderNode(new DialogNode(question, null, null, answer),
                                                 ++_ids);

            _nodes.Add(node);

            return(new NodeBuilder(node, this));
        }
Beispiel #2
0
        public NodeBuilder GetNode(string question)
        {
            DialogTreeBuilderNode node = null;

            foreach (var n in _nodes)
            {
                if (n.Node.Question == question)
                {
                    node = n;
                }
            }

            if (node == null)
            {
                throw new InvalidOperationException();
            }

            return(new NodeBuilder(node, this));
        }
Beispiel #3
0
 public NodeBuilder(DialogTreeBuilderNode node, DialogTreeBuilder builder)
 {
     _node    = node;
     _builder = builder;
 }