Beispiel #1
0
        public TopicEntry GetTopic(CreatureEntity collocutor, int conversationIndex, TopicEntry parentTopic, string phrase)
        {
            TopicEntry result = null;

            DialogEntry       dlg        = Dialog;
            ConversationEntry curConvers = dlg.GetConversation(conversationIndex);

            if (parentTopic == null)
            {
                result = curConvers.GetTopic(0);
            }
            else
            {
                for (int i = 0; i < parentTopic.TopicsCount; i++)
                {
                    TopicEntry subTopic = parentTopic.GetTopic(i);
                    if ((subTopic.Phrase == phrase))
                    {
                        result = subTopic;
                        break;
                    }
                }
            }

            return(result);
        }
        private void UpdateConversations()
        {
            fConversations.Items.BeginUpdate();
            fConversations.Items.Clear();

            SentientBrain b   = (SentientBrain)fCollocutor.Brain;
            DialogEntry   dlg = b.Dialog;

            int num = dlg.ConversationsCount;

            for (int i = 0; i < num; i++)
            {
                fConversations.Items.Add(dlg.GetConversation(i).Name, null);
            }

            fConversations.Items.EndUpdate();

            fTextBox.Lines.Text = "";
        }