private record PathRequest( IMap Map, int StartColumn, int StartRow, int GoalColumn, int GoalRow, Locomotion Locomotion, IPathfindingCallback Callback, int CallbackContext );
public void GetPath(IMap map, ref MapCell start, ref MapCell goal, Locomotion locomotion, IPathfindingCallback callback, int callbackContext) { if (!IsRunning) { throw new InvalidOperationException("Attempt to path with stopped pathfinding manager."); } var request = new PathRequest( map, start.Column, start.Row, goal.Column, goal.Row, locomotion, callback, callbackContext ); _requests.Enqueue(request); _gate.Set(); }