示例#1
0
 public GoapRequest(I_GoapAgent _agent, I_GoapAction[] _actions, HashSet <string> _worldState, HashSet <string> _goalState, Action <List <I_GoapAction> > _callback)
 {
     owner      = _agent;
     agentPos   = _agent.GetPositionXZ();
     actions    = _actions;
     worldState = _worldState;
     goalState  = _goalState;
     callback   = _callback;
 }
示例#2
0
        public void PlanAsync(I_GoapAgent _agent, HashSet <string> _worldState, HashSet <string> _goalState, I_GoapActionSet _actionSet, Action <List <I_GoapAction> > _callback)
        {
            Vector2 agentPos = _agent.GetPositionXZ();

            I_GoapAction[] actions  = _actionSet.GetActions();
            GoapRequest    gRequest = new GoapRequest(_agent, actions, _worldState, _goalState, _callback);

            //thread safe enqueue
            pendingRequests.Enqueue(gRequest);
        }
示例#3
0
 public virtual void InitPlanning(GoapPlanner.PlanningData _planningData)
 {
     owner    = _planningData.goapAgent;
     ownerPos = _planningData.agentPositonXZ;
 }