Beispiel #1
0
        protected override void OnAssetDataLoaded(IntegratedAuthoringToolAsset asset)
        {
            textBoxScenarioName.Text        = asset.ScenarioName;
            textBoxScenarioDescription.Text = asset.ScenarioDescription;
            _characterSources = new BindingListView <CharacterSourceDTO>(asset.GetAllCharacterSources().ToList());
            _wmSource         = asset.GetWorldModelSource();
            dataGridViewCharacters.DataSource = _characterSources;
            _dialogs = new BindingListView <DialogueStateActionDTO>(new List <DialogueStateActionDTO>());
            dataGridViewDialogueActions.DataSource = _dialogs;

            if (_wmSource != null)
            {
                if (_wmSource.Source != "")
                {
                    pathTextBoxWorldModel.Text = _wmSource.Source;
                    LoadWorldModelForm();
                }
            }

            //ResetSimulator
            richTextBoxChat.Clear();
            buttonContinue.Enabled = false;
            textBoxTick.Text       = "";

            RefreshDialogs();
        }
        public IntegratedAuthoringToolAsset()
        {
            m_dialogues        = new DialogActionDictionary();
            m_characterSources = new List <CharacterSourceDTO>();
            m_worldModelSource = new WorldModelSourceDTO();

            eventTriggers = new EventTriggers();
        }
Beispiel #3
0
        public void SetObjectData(ISerializationData dataHolder, ISerializationContext context)
        {
            ScenarioName = dataHolder.GetValue <string>("ScenarioName");

            ScenarioDescription = dataHolder.GetValue <string>("Description");
            var relativePath = dataHolder.GetValue <string>("WorldModelSource");

            if (relativePath != null)
            {
                m_worldModelSource = new WorldModelSourceDTO()
                {
                    Source = ToAbsolutePath(relativePath), RelativePath = null
                }
            }
            ;

            //Load Character Sources
            m_characterSources = new List <CharacterSourceDTO>();
            var charArray = dataHolder.GetValue <string[]>("CharacterSources");

            if (charArray != null)
            {
                for (int i = 0; i < charArray.Length; i++)
                {
                    m_characterSources.Add(new CharacterSourceDTO {
                        Id = i, Source = charArray[i]
                    });
                }
            }


            //Load Agent Dialogues
            m_dialogues = new DialogActionDictionary();
            var agentDialogueArray = dataHolder.GetValue <DialogueStateActionDTO[]>("Dialogues");

            if (agentDialogueArray != null)
            {
                foreach (var d in agentDialogueArray.Select(dto => new DialogStateAction(dto)))
                {
                    m_dialogues.AddDialog(d);
                }
            }
        }