コード例 #1
0
        /// <summary>
        /// Shows the script diagram panel for the given <see cref="tree"/> identifier
        /// </summary>
        /// <param name="tree">Dialog Tree to show</param>
        public void ShowScriptDiagramPanel(DialogTreeIdentifier tree)
        {
            DialogTree dialogTree = m_project[tree];

            if (dialogTree == null)
            {
                return;
            }

            ScriptDiagramVM window = Windows.Select(w => w as ScriptDiagramVM)
                                     .Where(s => s != null)
                                     .FirstOrDefault(s => s.Tree == tree);

            if (window == null)
            {
                window = new ScriptDiagramVM(m_project, dialogTree);
                Windows.Add(window);
            }

            window.IsSelected = true;
            if (m_dockingManager != null)
            {
                m_dockingManager.ActiveContent = window;
            }
        }
コード例 #2
0
        public void DialogGetter(int offset)
        {
            DialogTree tree = m_project.ProjectDialogs.CreateNewDialogTree();

            Assert.IsNotNull(tree);
            Assert.IsNotNull(m_project.ProjectDialogs[tree]);
            DialogTreeIdentifier fakeTreeId = new DialogTreeIdentifier(tree.Id.DialogTreeId + offset);

            Assert.IsNull(m_project.ProjectDialogs[fakeTreeId]);

            DialogTreeBranch branch = tree.CreateNewBranch();

            Assert.IsNotNull(branch);
            Assert.IsNotNull(m_project.ProjectDialogs[branch]);
            DialogTreeBranchIdentifier fakeBranchId = new DialogTreeBranchIdentifier(branch.Id, branch.Id.DialogTreeBranchId + offset);

            Assert.IsNull(m_project.ProjectDialogs[fakeBranchId]);

            DialogSegment dialogSegment = branch.CreateNewDialog(CharacterId.DefaultId);

            Assert.IsNotNull(dialogSegment);
            Assert.IsNotNull(m_project.ProjectDialogs[dialogSegment.Id]);
            DialogSegmentIdentifier fakeSegmentId = new DialogSegmentIdentifier(dialogSegment.Id, dialogSegment.Id.DialogSegmentId + offset);

            Assert.IsNull(m_project.ProjectDialogs[fakeSegmentId]);
        }
コード例 #3
0
        public void Tree()
        {
            DialogTreeIdentifier id1 = new DialogTreeIdentifier(23);
            DialogTreeIdentifier id2 = new DialogTreeIdentifier(666);

            Assert.IsFalse(id1.Compatible(id2));
            Assert.IsTrue(id1.Compatible(new DialogTreeIdentifier(id1.DialogTreeId)));
        }
コード例 #4
0
 /// <summary>
 /// Find specific dialog by id
 /// </summary>
 /// <param name="id">id of the character</param>
 /// <returns>character if found, null if not found</returns>
 public DialogTree GetDialog(DialogTreeIdentifier id)
 {
     if (id == null)
     {
         return(null);
     }
     return(GetDialog(id.DialogTreeId));
 }
コード例 #5
0
        public void SegmentToTree()
        {
            DialogTreeIdentifier    id1 = new DialogTreeIdentifier(23);
            DialogSegmentIdentifier id2 = new DialogSegmentIdentifier(666, 2, 5);

            Assert.IsFalse(id1.Compatible(id2));

            id2 = new DialogSegmentIdentifier(23, 2, 5);
            Assert.IsTrue(id1.Compatible(id2));
        }
コード例 #6
0
        public void BranchToTree()
        {
            DialogTreeIdentifier       id1 = new DialogTreeIdentifier(23);
            DialogTreeBranchIdentifier id2 = new DialogTreeBranchIdentifier(666, 2);

            Assert.IsFalse(id1.Compatible(id2));

            id2 = new DialogTreeBranchIdentifier(23, 2);
            Assert.IsTrue(id1.Compatible(id2));
        }
コード例 #7
0
 public void SetDialogTree(DialogTreeIdentifier dialogTreeId)
 {
     throw new NotImplementedException();
 }
コード例 #8
0
        public bool HasDialog(DialogTreeIdentifier id)
        {
            DialogTree tree = this[id];

            return(tree != null);
        }
コード例 #9
0
 public DialogTree this[DialogTreeIdentifier id] => GetDialog(id);
コード例 #10
0
 // convenient lookups
 public DialogTree this[DialogTreeIdentifier id] => ProjectDialogs[id];