Beispiel #1
0
        public bool CanRunGoal(IGoapAgent agent, IGoapGoal goal)
        {
            if (agent.GetCurrentGoal() == goal)
            {
                return(false);
            }

            if (goal.CanRun(agent) == false)
            {
                return(false);
            }

            GoapState differenceState = goal.GetGoalState(agent).Clone();

            differenceState.RemoveCompletedConditions(m_agent.GetMemory().GetWorldState());

            if (differenceState.Count == 0)
            {
                return(false);
            }


            return(true);
        }