void BuildDecisionTree()
    {
        idle    = new DT_Action(ActionInit_Idle, ActionUpdate_Idle, ActionEnd_Idle);
        inspect = new DT_Action(ActionInit_Inspect, ActionUpdate_Inspect, ActionEnd_Inspect);
        attack  = new DT_Action(ActionInit_Attack, ActionUpdate_Attack, ActionEnd_Attack);

        //TODO: YOUR CODE HERE (Q1)
        DT_Decision dtNode_InAttackRange = new DT_Decision(IsInAttackRange, attack, inspect);

        dtNode_Root = new DT_Decision(CanSeePlayer, dtNode_InAttackRange, idle);

        dt_LastAction = null;
    }
Exemple #2
0
    public override DT_Node MakeDecision()
    {
        DT_Node branch = GetBranch();

        return(branch.MakeDecision());
    }
Exemple #3
0
 public DT_Decision(DT_Decision_Func decisionFunction, DT_Node trueNode, DT_Node falseNode)
 {
     this.decisionFunction = decisionFunction;
     this.trueNode         = trueNode;
     this.falseNode        = falseNode;
 }