Exemple #1
0
 public void RunChildDecision(DMTestObjectScript agentInformation, bool value)
 {
     if (value)
     {
         if (TrueNode != null)
         {
             TrueNode.MakeDecision(agentInformation);
             return;
         }
         else if (TrueAction != null)
         {
             TrueAction.TakeAction(agentInformation);
             return;
         }
     }
     else
     {
         if (FalseNode != null)
         {
             FalseNode.MakeDecision(agentInformation);
             return;
         }
         else if (FalseAction != null)
         {
             FalseAction.TakeAction(agentInformation);
             return;
         }
     }
     //Debug.Log("No Further Decisions Or Actions!");
 }
    public bool TestValue(int valueToTest, DMTestObjectScript testObject)
    {
        if (valueToTest >= mValueToCheck)
        {
            testObject.ChangeValueBy(-mAmountToTake);
        }

        return(valueToTest >= mValueToCheck);
    }
 public override void MakeDecision(DMTestObjectScript agentScript)
 {
     if (agentScript.mAmount >= 50)
     {
         RunChildDecision(agentScript, true);
     }
     else
     {
         RunChildDecision(agentScript, false);
     }
 }
Exemple #4
0
 public override void TakeAction(DMTestObjectScript agentScript)
 {
     agentScript.ChangeValueBy(10);
 }
Exemple #5
0
 public virtual void TakeAction(DMTestObjectScript agentInformation)
 {
 }
Exemple #6
0
 public virtual void MakeDecision(DMTestObjectScript agentInformation)
 {
 }
 public override void TakeAction(DMTestObjectScript agentScript)
 {
     agentScript.mAltActive = !agentScript.mAltActive;
 }