Ejemplo n.º 1
0
        public IDialogTree SelectDialog(History history, Intention intention)
        {
            if (intention == null)
            {
                DebugLog.Warn("Intention is null. Returning null.");
                return(null);
            }
            // Select a dialog tree
            YarnDialogTree dialogTree = SelectDialogYarn(history, intention, dialogue.allNodes.ToList());

            if (dialogTree == null)
            {
                DebugLog.Warn("No Dialog Tree was created. Returning null.");
            }
            return(dialogTree);
        }
        public IDialogTree SelectDialog(History history, Intention intention)
        {
            if (intention == null)
            {
                DebugLog.Warn("Intention is null. Returning null.");
                return(null);
            }
            // Get all nodes
            IEnumerable <string> allNodes = Dialogue.allNodes;
            // Select a dialog tree
            YarnDialogTree dialogTree = SelectDialogYarn(history, intention, allNodes.ToList());

            if (dialogTree == null)
            {
                DebugLog.Warn("No Dialog Tree was created. Returning null. Given intention is " + intention.Name);
            }
            return(dialogTree);
        }
Ejemplo n.º 3
0
        public IDialogTree SelectDialog(History history, Intention intention)
        {
            if (intention == null)
            {
                DebugLog.Warn("Intention is null. Returning null.");
                return(null);
            }
            // Get all nodes
            IEnumerable <string> allNodes = dialogue.allNodes;
            // Filter to only start nodes
            List <string> startNodes = GetNodesStartWith(allNodes, "Start.");
            // Select a dialog tree
            YarnDialogTree dialogTree = SelectDialogYarn(history, intention, startNodes);

            if (dialogTree == null)
            {
                DebugLog.Warn("No Dialog Tree was created. Returning null.");
            }
            return(dialogTree);
        }
Ejemplo n.º 4
0
        public void SetDialogTree(IDialogTree dialogTree)
        {
            if (dialogTree == null)
            {
                DebugLog.Warn("Dialog Tree is null");
                return;
            }

            if (dialogTree.Equals(this._dialogTree))
            {
                Reset();
                return;
            }

            if (dialogTree is YarnDialogTree)
            {
                this._dialogTree = (YarnDialogTree)dialogTree;
                Reset();
            }
            else
            {
                DebugLog.Warn("Dialog Tree is not a YarnDialogTree. It is " + dialogTree);
            }
        }