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; }
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); }