Ejemplo n.º 1
0
 private void saveNodeIsActiveFalseToModule(ContentNode nod)
 {
     ConvoSavedValues newCSV = new ConvoSavedValues();
     newCSV.ConvoFileName = currentConvo.ConvoFileName;
     newCSV.NodeNotActiveIdNum = nod.idNum;
     mod.moduleConvoSavedValuesList.Add(newCSV);
 }
Ejemplo n.º 2
0
 private bool nodePassesConditional(ContentNode pnode)
 {
     //check to see if passes conditional
     bool check = true;
     ContentNode chkNode = new ContentNode();
     chkNode = pnode;
     // cycle through the conditions of each node and check for true
     // if one node is a link, then go to the linked node and check its conditional
     if (pnode.isLink)
     {
         chkNode = currentConvo.GetContentNodeById(pnode.linkTo);
     }
     bool AndStatments = true;
     foreach (Condition conditional in chkNode.conditions)
     {
         if (!conditional.c_and)
         {
             AndStatments = false;
             break;
         }
     }
     foreach (Condition conditional in chkNode.conditions)
     {
         gv.cc.doScriptBasedOnFilename(conditional.c_script, conditional.c_parameter_1, conditional.c_parameter_2, conditional.c_parameter_3, conditional.c_parameter_4);
         if (AndStatments) //this is an "and" set
         {
             if ((mod.returnCheck == false) && (conditional.c_not == false))
             {
                 check = false;
             }
             if ((mod.returnCheck == true) && (conditional.c_not == true))
             {
                 check = false;
             }
         }
         else //this is an "or" set
         {
             if ((mod.returnCheck == false) && (conditional.c_not == false))
             {
                 check = false;
             }
             else if ((mod.returnCheck == true) && (conditional.c_not == true))
             {
                 check = false;
             }
             else //in "or" statement, if find one true then done
             {
                 check = true;
                 break;
             }
         }
         //MessageBox.Show("script: " + conditional.c_script + "  variable: " + conditional.c_parameter_1 + "  value: " + conditional.c_parameter_2);
     }
     return check;
 }