Exemple #1
0
        public void PossibleBranchLinkAdded2()
        {
            NpcChatProject project = new NpcChatProject();
            DialogTree     tree    = project.ProjectDialogs.CreateNewDialogTree();

            DialogTreeBranch a = tree.GetStart();

            a.Name = "A";
            BranchTestScriptView branchTest = new BranchTestScriptView();
            TreeBranchVM         aBranch    = new TreeBranchVM(project, branchTest, a);

            branchTest.Branches.Add(aBranch);

            Assert.IsFalse(aBranch.AreBranchLinksPossible, "Branch links are possible as there are no other branches");
            Assert.AreEqual(0, aBranch.PotentialBranchLinks.Count);

            DialogTreeBranch b = tree.CreateNewBranch();

            b.Name = "B";
            TreeBranchVM bBranch = new TreeBranchVM(project, branchTest, b);

            branchTest.Branches.Add(bBranch);

            //no relation between the branches so all links are possible
            TestBranchPossibility(aBranch, b);
            TestBranchPossibility(bBranch, a);

            // link a to b so that the options for both branches are limited
            RelationshipCreate(a, b);

            //A is parent of B so there should be no possible actions
            TestBranchPossibility(aBranch);
            TestBranchPossibility(bBranch);
        }
Exemple #2
0
        public void PossibleBranchLinkPreExisting()
        {
            NpcChatProject project = new NpcChatProject();
            DialogTree     tree    = project.ProjectDialogs.CreateNewDialogTree();

            DialogTreeBranch a = tree.GetStart();

            a.Name = "A";
            BranchTestScriptView branchTest = new BranchTestScriptView();
            TreeBranchVM         aBranch    = new TreeBranchVM(project, branchTest, a);

            branchTest.Branches.Add(aBranch);

            //no other branches so there shouldn't be any possibilities
            TestBranchPossibility(aBranch);

            DialogTreeBranch b = tree.CreateNewBranch();

            b.Name = "B";
            RelationshipCreate(a, b);

            TreeBranchVM bBranch = new TreeBranchVM(project, branchTest, b);

            branchTest.Branches.Add(bBranch);

            //branches already linked so there shouldn't be any possible links
            TestBranchPossibility(aBranch);
            TestBranchPossibility(bBranch);
        }
Exemple #3
0
        public void PossibleBranchLinkAdded()
        {
            NpcChatProject project = new NpcChatProject();
            DialogTree     tree    = project.ProjectDialogs.CreateNewDialogTree();

            DialogTreeBranch a = tree.GetStart();

            a.Name = "A";
            BranchTestScriptView branchTest = new BranchTestScriptView();
            TreeBranchVM         aBranch    = new TreeBranchVM(project, branchTest, a);

            branchTest.Branches.Add(aBranch);

            TestBranchPossibility(aBranch);

            DialogTreeBranch b = tree.CreateNewBranch();

            b.Name = "B";

            TestBranchPossibility(aBranch, b);
        }
Exemple #4
0
        public void PossibleBranchLinkDeleted()
        {
            NpcChatProject       project    = new NpcChatProject();
            DialogTree           tree       = project.ProjectDialogs.CreateNewDialogTree();
            BranchTestScriptView branchTest = new BranchTestScriptView();

            DialogTreeBranch a = tree.GetStart();

            a.Name = "A";
            TreeBranchVM aBranch = new TreeBranchVM(project, branchTest, a);

            branchTest.Branches.Add(aBranch);

            DialogTreeBranch b = tree.CreateNewBranch();

            b.Name = "B";
            TreeBranchVM bBranch = new TreeBranchVM(project, branchTest, b);

            branchTest.Branches.Add(bBranch);

            DialogTreeBranch c = tree.CreateNewBranch();

            c.Name = "C";
            TreeBranchVM cBranch = new TreeBranchVM(project, branchTest, c);

            branchTest.Branches.Add(cBranch);

            RelationshipCreate(a, b);
            RelationshipCreate(b, c);

            TestBranchPossibility(aBranch, c);
            TestBranchPossibility(bBranch);
            TestBranchPossibility(cBranch);

            tree.RemoveBranch(b);

            TestBranchPossibility(aBranch, c);
            TestBranchPossibility(cBranch, a);
        }