Class MovePathFinder<C>

Direct Known Subclasses:
LongestPathFinder, ShortestPathFinder

public class MovePathFinder<C> extends AbstractPathFinder<CoordsWithFacing,C,MovePath>
Generic implementation of AbstractPathFinder when we restrict graph nodes to (coordinates x facing) and edges to MovePaths. Provides useful implementations of functional interfaces defined in AbstractPathFinder.
  • Constructor Details

  • Method Details

    • getAllComputedCosts

      protected Map<Coords,C> getAllComputedCosts(Comparator<C> comp)
      Returns a map of all computed shortest paths
    • getCost

      @Nullable protected C getCost(Coords coords, Comparator<C> comp)
      Returns computed cost to reach the hex at c coordinates. If multiple path are present with different final facings, the one minimal one is chosen. If none paths are present then null is returned.
      Parameters:
      comp - comparator used if multiple paths are present
      Returns:
      shortest path to the hex at c coordinates or null