当前位置: 首页>>代码示例>>C#>>正文


C# TreeNode.moveToCurrNode方法代码示例

本文整理汇总了C#中TreeNode.moveToCurrNode方法的典型用法代码示例。如果您正苦于以下问题:C# TreeNode.moveToCurrNode方法的具体用法?C# TreeNode.moveToCurrNode怎么用?C# TreeNode.moveToCurrNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TreeNode的用法示例。


在下文中一共展示了TreeNode.moveToCurrNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: qnGenerator

    // this function generate questions based on  the timeline generated
    public static TreeNode qnGenerator()
    {
        TreeNode temp = new TreeNode();
        string question;
        string answer;
        int unlockerOne = 0;
        int unlockerTwo = 0;

        string firstTime = AI.convertTime(GenerateTimeline.befMurderTime);
        string secondTime = AI.convertTime(GenerateTimeline.deathTime);
        string thirdTime = AI.convertTime(GenerateTimeline.aftMurderTime);
        string fourthTime = AI.convertTime(GenerateTimeline.bodyFound);

        // This runs a loop that covers all the questions
        // each question comes in the form of a 'if' loop
        for (int i=1; i<=20;i++) {
            if (i == 1) { // question 1
                for (int j=0;j<Globals.numSuspects;j++) {
                    question = "Did you find the body?";
                    answer = "Yes, I found it at " + fourthTime + ".";
                    if (GenerateTimeline.timeline[j].isFoundBody()) {
                        temp.setQnNode(1,question,answer,j,true,true,'s',0);
                        unlockerOne = j;
                    }
                    else {
                        temp.setQnNode(1,question,"No, I did not.",j,true,false,'s',0);
                    }
                }
                temp.moveToCurrNode();
            }
            else if (i == 2) { // question 2
                for (int j=0;j<Globals.numSuspects;j++) {
                    question = "When and where did you last see Mr. Darcy?";
                    if (GenerateTimeline.timeline[j].isLastSaw()) {
                        answer = "I last saw him at " + firstTime + " in the " + GenerateTimeline.victim.getBMPlace() + ".";
                        unlockerTwo = j;
                        temp.setQnNode(2,question,answer,j,false,true,'n',10+unlockerOne);
                    }
                    else {
                        answer = "I last saw him a long time before the murder timing, so I don't think I can help you.";
                        temp.setQnNode(2,question,answer,j,false,false,'n',10+unlockerOne);
                    }
                }
            }
            else if (i == 3) { // question 3
                for (int j=0;j<Globals.numSuspects;j++) {
                    if (GenerateTimeline.timeline[j].getAMWpn() != WpnEnum.None) {
                        question = "What were you doing around the time " + fourthTime + ", when the body is found?";
                        answer = "I was " + GenerateTimeline.timeline[j].getAMActivity() + " using " + GenerateTimeline.timeline[j].getAMWpn() + " from " +
                        thirdTime + " to " + fourthTime + ".";
                        temp.setQnNode(3,question,answer,j,false,true,'n',10+unlockerOne);
                    }
                    else {
                        question = "What were you doing around the time " + fourthTime + ", when the body is found?";
                        answer = "I was " + GenerateTimeline.timeline[j].getAMActivity() + " from " + thirdTime + " to " + fourthTime + ".";
                        temp.setQnNode(3,question,answer,j,false,true,'n',10+unlockerOne);
                    }
                }
                temp.moveToCurrNode();
            }
            else if (i == 4) { // question 4
                for (int j=0;j<Globals.numSuspects;j++) {
                    if (GenerateTimeline.timeline[j].getBMWpn() != WpnEnum.None) {
                        question = "What were you doing around the time " + firstTime + ", when Mr. Darcy was last seen?";
                        answer = "I was " + GenerateTimeline.timeline[j].getBMActivity() + " using " + GenerateTimeline.timeline[j].getBMWpn() + " from " +
                        firstTime + " to " + secondTime + ".";
                        temp.setQnNode(4,question,answer,j,false,true,'n',20+unlockerTwo);
                    }
                    else {
                        question = "What were you doing around the time " + firstTime + ", when Mr. Darcy was last seen?";
                        answer = "I was " + GenerateTimeline.timeline[j].getBMActivity() + " from " + firstTime + " to " + secondTime + ".";
                        temp.setQnNode(4,question,answer,j,false,true,'n',20+unlockerTwo);
                    }
                }
            }
            else if (i == 5) { // question 5
                for (int j=0;j<Globals.numSuspects;j++) {
                    question = "You were " + GenerateTimeline.timeline[j].getAMActivity() + " from " + thirdTime + " to " + fourthTime + " at...?";
                    answer = "I was at " + GenerateTimeline.timeline[j].getAMPlace() + ".";
                    temp.setQnNode(5,question,answer,j,false,true,'n',30+j);
                }
                temp.moveToCurrNode();
            }
            else if (i == 6) { // question 6
                for (int j=0;j<Globals.numSuspects;j++) {
                    if (GenerateTimeline.timeline[j].getDMWpn() != WpnEnum.None) {
                        question = "Then what about your activity between the unaccounted time of " + secondTime + " and " + thirdTime + "?";
                        answer = "I was " + GenerateTimeline.timeline[j].getDMActivity() + " using " + GenerateTimeline.timeline[j].getDMWpn() + ".";
                        temp.setQnNode(6,question,answer,j,false,true,'n',40+j);
                    }
                    else {
                        question = "Then what about your activity between the unaccounted time of " + secondTime + " and " + thirdTime + "?";
                        answer = "I was " + GenerateTimeline.timeline[j].getDMActivity() + ".";
                        temp.setQnNode(6,question,answer,j,false,true,'n',40+j);
                    }
                }
            }
            else if (i == 7) { // question 7
                for (int j=0;j<Globals.numSuspects;j++) {
//.........这里部分代码省略.........
开发者ID:abdalla4dev,项目名称:dagamers,代码行数:101,代码来源:AI.cs


注:本文中的TreeNode.moveToCurrNode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。