示例#1
0
    public GoapAction GetPerformerAction()
    {
        GoapAction goapAction = null;

        if (goapActionQueue.Count <= 0)
        {
            GoapStatus worldStatus = goapGoal.GetWorldStatus();
            GoapStatus goalStatus  = goapGoal.GetGoalStatus();

            goapActionQueue = goapPlan.Plan(usableGoapActionList, worldStatus, goalStatus);
        }

        if (goapActionQueue.Count <= 0)
        {
            return(goapAction);
        }

        goapAction = goapActionQueue.Dequeue();
        return(goapAction);
    }
示例#2
0
    public GoapAction GetPerformerAction()
    {
        Queue <GoapAction> goapActionQueue = new Queue <GoapAction>();
        GoapAction         goapAction      = null;

        if (goapActionQueue.Count <= 0)
        {
            GoapStatus worldStatus = goapAgent.GoapStateManager.GetWorldStatus();
            GoapStatus goalStatus  = goapAgent.GoapStateManager.GetGoalStatus();

            List <GoapAction> usableGoapActionList = goapAgent.GoapActionManager.GetActions();
            goapActionQueue = goapPlan.Plan(usableGoapActionList, worldStatus, goalStatus);
        }

        if (goapActionQueue.Count <= 0)
        {
            return(goapAction);
        }

        goapAction = goapActionQueue.Dequeue();
        return(goapAction);
    }