private void FindPath(PathFindReq req) { if (req == null) { return; } FindPath(req.startCellId, req.endCellId, req.type, req.action); }
public void ConductFindPath(int num) { if (m_Requests.Count == 0) { return; } int conductNum = Math.Min(m_Requests.Count, num); for (int i = 0; i < conductNum; i++) { PathFindReq req = m_Requests.Dequeue(); FindPath(req); } }
public void FindPathRequest(int startCellId, int endCellId, PathFindAlg type, Action <List <int> > action = null) { PathFindReq req = new PathFindReq(); req.startCellId = startCellId; req.endCellId = endCellId; req.type = type; req.action = action; foreach (var request in m_Requests) { if (request.startCellId == startCellId && request.endCellId == endCellId && request.type == type && request.action == action) { return; } } m_Requests.Enqueue(req); }