Example #1
0
    public void Update()
    {
        if (_newAppraisal)
        {
            // Affective Appraisal
            AffectiveAppraisal.ComputeUserEmotion(History, User);
            foreach (Tutor tutor in Tutors)
            {
                AffectiveAppraisal.ComputeTutorEmotion(History, User, tutor);
            }

            // Empathic Strategy
            Intention intention = EmpathicStrategySelector.SelectIntention(History, Strategies, User);

            // Dialog Selector
            IDialogTree dialogTree = DialogSelector.SelectDialog(History, intention);

            DialogManager.SetDialogTree(dialogTree);
            foreach (Tutor tutor in Tutors)
            {
                DialogManager.SetTutorEmotion(tutor);
            }
        }

        _newAppraisal = DialogManager.Update();
    }
Example #2
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);
            }
        }