Exemplo n.º 1
0
 // this function goes thorugh the tree testing differnt decsisions until it reaches a leaf node
 public void TraverseTree(TheNode TheCurrentNode, RealBattleUIScript TheUI, MonsterScript TheMonster)
 {
     if (TheCurrentNode.LeafNode)
     {
         CurrentNode.ExecuteAction(TheUI);
     }
     else
     {
         CurrentNode = TheCurrentNode.MakeDecision(TheMonster);
         // the function does not do anything yet
         //CurrentNode = TheCurrentNode.MakeDecision();
         TraverseTree(CurrentNode, TheUI, TheMonster);
     }
 }
Exemplo n.º 2
0
 // this is what will use the skill depending on the circumstances
 public override void ExecuteAction(RealBattleUIScript TheUI)
 {
     if (TheActionName == "SkillOne")
     {
         TheAction.UseMonsterSkillOne(TheUI);
     }
     else if (TheActionName == "SkillTwo")
     {
         TheAction.UseMonsterSkillTwo(TheUI);
     }
     else if (TheActionName == "SkillThree")
     {
         TheAction.UseMonsterSkillThree(TheUI);
     }
 }
Exemplo n.º 3
0
 // this funcion starts the decision tree
 public void Execute(RealBattleUIScript TheUI, MonsterScript CurrentMonster)
 {
     TraverseTree(TheRootNode, TheUI, CurrentMonster);
 }
Exemplo n.º 4
0
 // the node needs the ability to execute actions and made a decsision depending on the type of node
 public virtual void ExecuteAction(RealBattleUIScript TheUI)
 {
 }
Exemplo n.º 5
0
 public void UseMonsterSkillThree(RealBattleUIScript TheBattleUI)
 {
     TheBattleUI.UseSkillThreeAI();
 }