Package megamek.client.bot.princess
Class AeroPathUtil
java.lang.Object
megamek.client.bot.princess.AeroPathUtil
Helper class that contains functionality relating mostly to aero unit paths.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic intcalculateMaxSafeThrust(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.static Collection<MovePath> generateValidAccelerations(MovePath startingPath, int lowerBound, int upperBound) Generates paths that begin with all valid acceleration sequences for this aircraft.Given a move path, generate all possible increases and decreases in elevation.Given a move path, generates all possible rotations from it, without any regard to legality.static intgetSpheroidDir(Game game, Entity mover) static List<List<MoveStepType>> getTurns()static booleanisSafePathOffBoard(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.static booleanDetermines if the aircraft undertaking the given path will become a lawn dartstatic booleanDetermines if the aircraft undertaking the given path will stall at the end of the turn.
-
Field Details
-
TURNS
-
-
Method Details
-
getTurns
-
willStall
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
Determines if the aircraft undertaking the given path will become a lawn dart- Parameters:
movePath- the path to check- Returns:
- True or false
-
isSafePathOffBoard
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
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
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
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
-