Package megamek.common.weapons
Class ArtilleryHandlerHelper
java.lang.Object
megamek.common.weapons.ArtilleryHandlerHelper
Contains some helper methods for artillery and similar weapon handlers.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidclearMines(Vector<Report> reports, Coords coords, Game game, Entity attacker, TWGameManager gameManager) findSpotter(List<Integer> spottersBefore, int playerId, Game game, Targetable target) static voidgetMinefields(Vector<Report> reports, Coords coords, Game game, Entity attacker, TWGameManager gameManager) static booleanisForwardObserver(Entity entity) static CoordsnearestOnBoardHexTowardOffBoard(Board board, Coords aimedHex, Coords offBoardScatter) Finds the board-edge hex an artillery round crossed when it scattered off the board: the last on-board hex along the straight line from where it was aimed to the (off-board) hex it scattered to.
-
Method Details
-
findSpotter
-
isForwardObserver
- Parameters:
entity- The unit in question- Returns:
- True when the given unit has the Forward Observer ability
- See Also:
-
clearMines
-
getMinefields
-
nearestOnBoardHexTowardOffBoard
@Nullable public static Coords nearestOnBoardHexTowardOffBoard(Board board, Coords aimedHex, Coords offBoardScatter) Finds the board-edge hex an artillery round crossed when it scattered off the board: the last on-board hex along the straight line from where it was aimed to the (off-board) hex it scattered to. The board view can then draw the drift arrow to that edge hex, showing the direction the round drifted off, since there is no on-board landing hex.- Parameters:
board- The board the round was fired ontoaimedHex- The on-board hex the round was aimed at (the drift line's origin)offBoardScatter- The off-board hex the round scattered to- Returns:
- The last on-board hex along the line toward
offBoardScatter(the edge it crossed), ornullifaimedHexis not even on the board
-