Class PathEnumerator

java.lang.Object
megamek.client.bot.princess.PathEnumerator

public class PathEnumerator extends Object
This class contains logic that calculates and stores a) possible paths that units in play can take, and b) their possible locations
  • Constructor Details

    • PathEnumerator

      public PathEnumerator(Princess owningPrincess, Game game)
  • Method Details

    • getEntitiesWithLocation

      public Set<Integer> getEntitiesWithLocation(Coords location, boolean groundOnly)
      Returns all Entity objects located at the given Coords.
      Parameters:
      location - The Coords to be searched for units.
      groundOnly - Set TRUE to ignore Aero units.
      Returns:
      A Set of Entity objects at the given Coords.
    • recalculateMovesFor

      public void recalculateMovesFor(Entity mover)
      Calculate what to do on my turn. Has a retry mechanism for when the turn calculation fails due to concurrency issues
    • isLegalAeroMove

      public boolean isLegalAeroMove(MovePath path)
      Returns whether a MovePath is legit for an Aero unit isMoveLegal() seems to disagree with me on some aero moves, but I can't exactly figure out why, and who is right. So, I'm just going to put a list of exceptions here instead of possibly screwing up MovePath.isMoveLegal() for everyone. I think it has to do with fly off or return at the end of a move. This also affects clip to possible
      Parameters:
      path - The path to be examined.
      Returns:
      TRUE if the path is legal.
    • getLongRangePaths

      protected Map<Integer,List<BulldozerMovePath>> getLongRangePaths()
    • getUnitPaths

      protected Map<Integer,List<MovePath>> getUnitPaths()
    • getUnitMovableAreas

      public Map<Integer,ConvexBoardArea> getUnitMovableAreas()
    • getUnitPotentialLocations

      protected Map<Integer,Set<CoordFacingCombo>> getUnitPotentialLocations()
    • getLastKnownLocations

      protected Map<Integer,CoordFacingCombo> getLastKnownLocations()
    • getGame

      protected Game getGame()
    • getSimilarUnitPaths

      protected List<MovePath> getSimilarUnitPaths(int moverId, BulldozerMovePath prunedPath)
      Find paths with a similar direction and step count to the provided path, within the selected unit's already-computed unit paths.