Class NewtonianAerospacePathRanker

All Implemented Interfaces:
IPathRanker

public class NewtonianAerospacePathRanker extends BasicPathRanker
  • Constructor Details

    • NewtonianAerospacePathRanker

      public NewtonianAerospacePathRanker(Princess owningPrincess)
  • Method Details

    • findClosestEnemy

      public Entity findClosestEnemy(Entity me, Coords position, Game game)
      Find the closest enemy to a unit with a path that ends at the given position.
      Specified by:
      findClosestEnemy in interface IPathRanker
      Overrides:
      findClosestEnemy in class PathRanker
    • calculateOffBoardMod

      protected double calculateOffBoardMod(MovePath path)
      Tells me whether this path will result in me flying to a location from which there is absolutely no way to remain on the board the following turn.

      We also take into account the possibility that we are intentionally trying to

      • retreat
      • fly off a particular
      edge
      Overrides:
      calculateOffBoardMod in class BasicPathRanker
      Parameters:
      path - The path to examine
      Returns:
      0 if we are A-Ok with it, .5 (maybe tune this) if we aren't looking to go off board
    • willFlyOffBoard

      public static boolean willFlyOffBoard(Entity entity, Coords coords)
      Whether an entity will go off board if it starts at the given coordinates with the given vectors.
      Parameters:
      entity - Entity to examine
      coords - Starting coordinates
      Returns:
      Whether the entity will go off board or not.
    • evaluateAsMoved

      protected boolean evaluateAsMoved(Entity enemy)
      Worker function that determines if a given enemy entity should be evaluated as if it has moved.
      Overrides:
      evaluateAsMoved in class BasicPathRanker