Class TowLinkWarning

java.lang.Object
megamek.client.ui.panels.phaseDisplay.TowLinkWarning

public class TowLinkWarning extends Object
When deploying units that are towing units, let's mark hexes that would break the tow linkage with warning. or something
  • Constructor Details

    • TowLinkWarning

      public TowLinkWarning()
  • Method Details

    • findTowLinkIssues

      public static List<BoardLocation> findTowLinkIssues(Game game, Entity entity)
    • findTowLinkIssues

      public static List<Coords> findTowLinkIssues(Game game, Entity entity, Board board) throws StackOverflowError
      This is used by the MovementDisplay class.
      Parameters:
      game - Game provided by the phase display class
      entity - Entity currently selected in the deployment phase.
      board - Board board object with hex data.
      Returns:
      returns a list of Coords that where warning flags should be placed.
      Throws:
      StackOverflowError - if there is a loop in the towing configuration, or it is longer than MAX_SEARCH_DEPTH
    • findValidDeployCoordsForTractorTrailer

      public static List<Coords> findValidDeployCoordsForTractorTrailer(Game game, Entity deployingEntity, Board board) throws StackOverflowError
      For the provided entity, find its associated tractor and trailer and find what coords this unit is able to deploy to. Will return an empty list for units that aren't tractors/trailers, so don't sue them for them!
      Parameters:
      game - Game provided by the phase display class
      deployingEntity - Entity currently selected in the deployment phase.
      board - Board board object with hex data.
      Returns:
      a list of Coords that this unit could deploy into that would let it connect with its tow connections. Empty if there are no valid locations or if it's not towing.
      Throws:
      StackOverflowError - if there is a loop in the towing configuration, or it is longer than MAX_SEARCH_DEPTH