Class AeroPathUtil

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

public class AeroPathUtil extends Object
Helper class that contains functionality relating mostly to aero unit paths.
  • Field Details

  • Method Details

    • getTurns

      public static List<List<MoveStepType>> getTurns()
    • willStall

      public static boolean willStall(MovePath movePath)
      Determines if the aircraft undertaking the given path will stall at the end of the turn. Only relevant for aerodyne units
      Parameters:
      movePath - the path to check
      Returns:
      whether the aircraft will stall at the end of the path
    • willCrash

      public static boolean willCrash(MovePath movePath)
      Determines if the aircraft undertaking the given path will become a lawn dart
      Parameters:
      movePath - the path to check
      Returns:
      True or false
    • isSafePathOffBoard

      public static boolean isSafePathOffBoard(MovePath movePath)
      A quick determination that checks the given path for the most common causes of a PSR and whether it leads us off board. The idea being that a safe path off board should not include any PSRs.
      Parameters:
      movePath - The path to check
      Returns:
      True or false
    • generateValidAccelerations

      public static Collection<MovePath> generateValidAccelerations(MovePath startingPath, int lowerBound, int upperBound)
      Generates paths that begin with all valid acceleration sequences for this aircraft.
      Parameters:
      startingPath - The initial path, hopefully empty.
      Returns:
      The child paths with all the accelerations this unit possibly can undertake.
    • calculateMaxSafeThrust

      public static int calculateMaxSafeThrust(IAero aero)
      Helper function to calculate the maximum thrust we should use for a particular aircraft We limit ourselves to the lowest of "safe thrust" and "structural integrity", as anything further is unsafe, meaning it requires a PSR.
      Parameters:
      aero - The aero entity for which to calculate max thrust.
      Returns:
      The max thrust.
    • generateValidAltitudeChanges

      public static List<MovePath> generateValidAltitudeChanges(MovePath path)
      Given a move path, generate all possible increases and decreases in elevation.
      Parameters:
      path - The move path to process.
      Returns:
      Collection of generated paths.
    • generateValidRotations

      public static List<MovePath> generateValidRotations(MovePath path)
      Given a move path, generates all possible rotations from it, without any regard to legality. Mostly because it's intended for spheroid DropShips in atmosphere, which can rotate as much as they want.
    • getSpheroidDir

      public static int getSpheroidDir(Game game, Entity mover)