public override FSMState Execute()
    {
        Queue <Action> actions = Planner.Plan(_agent.Actions(), _goal);

        if (actions == null)
        {
            return(new IdleState(null, _agent));
        }
        return(new ActState(actions, _agent, _goal, null));
    }
Exemple #2
0
    public override FSMState Execute()
    {
        Goal goal;

        if ((goal = _agent.PopGoal()) != null)
        {
            Queue <Action> todo;
            if ((todo = Planner.Plan(_agent.Actions(), goal)) != null)
            {
                return(new ActState(todo, _agent, goal, null));
            }
        }

        return(this);
    }