check Path Availability
Checks if all cells on path are available.
This method will iterate through all cells of the path in normal order and then run unitIsOk predicate for each unit found on that cell. If any of these runs fail, the path is considered not available.
Additionally, unitIsTarget is run for each unit on the path. If this predicate is satisfied, the iteration stops and the path is considered available.
If the iteration goes on for depth steps and all unitIsOk are satisfied to that point, the iteration stops and the path is considered available.
Return
true if path is considered available, false otherwise.
Parameters
The path to test.
The cell to start iterating path from.
The maximum number of steps to be taken along the path.
The predicate that decides whether a unit can appear on an available path.
The predicate that decides whether iteration can be stopped upon encountering a unit.