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]); }
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)); }
public void SegmentBranch() { DialogSegmentIdentifier id1 = new DialogSegmentIdentifier(23, 2, 30); DialogSegmentIdentifier id2 = new DialogSegmentIdentifier(666, 2, 30); Assert.IsFalse(id1.Compatible(id2)); id2 = new DialogSegmentIdentifier(23, 2, 30); Assert.IsTrue(id1.Compatible(id2)); id2 = new DialogSegmentIdentifier(23, 23, 30); Assert.IsFalse(id1.Compatible(id2)); id2 = new DialogSegmentIdentifier(23, 56, 30); Assert.IsFalse(id1.Compatible(id2)); }
public void Contains3() { DialogTree tree = m_project.ProjectDialogs.CreateNewDialogTree(); DialogTreeBranch branch = tree.CreateNewBranch(); DialogSegment one = branch.CreateNewDialog(12); Assert.IsTrue(branch.ContainsDialogSegment(one)); Assert.IsTrue(branch.ContainsDialogSegment(one.Id)); //make an id that has a different initial identifier but an id of an existing segment DialogTree tree2 = m_project.ProjectDialogs.CreateNewDialogTree(); DialogTreeBranch branch2 = tree2.CreateNewBranch(); DialogSegmentIdentifier fakeId = new DialogSegmentIdentifier(branch2.Id, one.Id.DialogSegmentId); Assert.IsFalse(branch.ContainsDialogSegment(fakeId)); }
public bool HasDialog(DialogSegmentIdentifier id) { DialogSegment dialogSegment = this[id]; return(dialogSegment != null); }
public DialogSegment this[DialogSegmentIdentifier id] => GetDialog(id)?[id];
public DialogSegment this[DialogSegmentIdentifier id] => ProjectDialogs[id];