Example #1
0
        public void StartDialog(string id)
        {
            _currentElement = DialogElements.Find(e => e.ID == id); //obacht
            _currentElement.CommandsAtEnter.ForEach(CommandManager.Instance.EvalCommand);

            DialogStarted(_currentElement);
        }
Example #2
0
        public bool NextDialog(int index)
        {
            var last = _currentElement;

            _currentElement.Answers[index]?.CommandsOnExit.ForEach(CommandManager.Instance.EvalCommand); //obacht
            _currentElement = DialogElements.Find(e => e.ID == _currentElement.Answers[index].LinkedID); //obacht

            if (_currentElement.IsNull())
            {
                DialogFinished(last);
                return(false);
            }
            else
            {
                NextDialogStarted(_currentElement);
                return(true);
            }
        }