Exemplo n.º 1
0
    protected goalStatus processSubgoals()
    {
        while (subgoalList.Count > 0 &&
               (subgoalList.First.Value.hasFailed() || subgoalList.First.Value.isCompleted()))
        {
            subgoalList.First.Value.Terminate();
            subgoalList.RemoveFirst();
        }

        if (subgoalList.Count != 0)
        {
            goalStatus subgoalStatus = subgoalList.First.Value.Process();

            if (subgoalStatus == goalStatus.completed && subgoalList.Count > 1)
            {
                subgoalStatus = goalStatus.active;
            }

            if (subgoalStatus == goalStatus.active && isBuffered())
            {
                subgoalStatus = goalStatus.buffered;
            }

            return(subgoalStatus);
        }
        else
        {
            return(goalStatus.completed);
        }
    }
Exemplo n.º 2
0
 protected void ReactivateIfFailed()
 {
     if (hasFailed())
     {
         status = goalStatus.inactive;
     }
 }
Exemplo n.º 3
0
//public
    public Goal(BEnemy _owner)
    {
        owner  = _owner;
        status = goalStatus.inactive;
    }
Exemplo n.º 4
0
 public void SetInactive()
 {
     status = goalStatus.inactive;
 }