Class SpecialHexDisplay

java.lang.Object
megamek.common.SpecialHexDisplay
All Implemented Interfaces:
Serializable

public class SpecialHexDisplay extends Object implements Serializable
See Also:
  • Field Details

    • LARGE_EXPLOSION_IMAGE_RADIUS

      public static final int LARGE_EXPLOSION_IMAGE_RADIUS
      See Also:
    • SHD_VISIBLE_TO_OWNER

      public static int SHD_VISIBLE_TO_OWNER
      Only the owner may see this display
    • SHD_VISIBLE_TO_TEAM

      public static int SHD_VISIBLE_TO_TEAM
      The owner and members of his team can see this display
    • SHD_VISIBLE_TO_ALL

      public static int SHD_VISIBLE_TO_ALL
      Everyone can see this display
    • HEAT_MAP_PREFIX

      public static final String HEAT_MAP_PREFIX
      Prefix marking a bot artillery heat-map testing marker. The turn number to render on the hex follows this prefix immediately, up to the first space; the rest of the info is the hover text.
      See Also:
    • HEAT_MAP_KIND_PREDICTED

      public static final String HEAT_MAP_KIND_PREDICTED
      Marks a heat-map control token's kind as a predicted enemy position (drawn as a cold-to-hot color fill). It is the third colon-separated field of the token, e.g. [HM]<turn>:<heat>:P.
      See Also:
    • HEAT_MAP_KIND_FIRING

      public static final String HEAT_MAP_KIND_FIRING
      Marks a heat-map control token's kind as a hex this turn's plan is firing at (drawn as a crosshair icon). It is the third colon-separated field of the token, e.g. [HM]<turn>:<heat>:F.
      See Also:
    • NO_ROUND

      public static int NO_ROUND
  • Constructor Details

  • Method Details

    • createArtyAutoHit

      public static SpecialHexDisplay createArtyAutoHit(Player owner)
      Creates an Artillery Auto hit marker for the given player. It has no round limitation and is visible to team members of the owner.
      Parameters:
      owner - The owner of this auto hit hex
      Returns:
      A SpecialHexDisplay auto hit marker
    • createIncomingArty

      @Deprecated(since="0.51.0", forRemoval=true) public static SpecialHexDisplay createIncomingArty(Player owner, int landingGameRound)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates an Incoming Artillery marker for the given owner and the given round in which it will land. It has no round limitation and is visible to team members of the owner.
      Parameters:
      owner - The owner of this artillery attack
      Returns:
      A SpecialHexDisplay Incoming marker
    • createIncomingFire

      public static SpecialHexDisplay createIncomingFire(Player owner, int landingGameRound, String message)
      Creates an Incoming Artillery marker for the given owner and the given round in which it will land. It has no round limitation and is visible to team members of the owner.
      Parameters:
      owner - The owner of this artillery attack
      Returns:
      A SpecialHexDisplay Incoming marker
    • createArtyMiss

      public static SpecialHexDisplay createArtyMiss(Player owner, int round, String message)
      Creates an Artillery miss marker for the given owner and the given round in which it landed. It has no round limitation and is visible to everyone.
      Parameters:
      owner - The owner of this artillery attack
      round - The game round in which the attack landed and scattered
      message - The message to display for this board marker
      Returns:
      A SpecialHexDisplay Artillery Miss marker
    • thisRound

      public boolean thisRound(int testRound)
    • futureRound

      public boolean futureRound(int testRound)
      Does this SpecialHexDisplayObjet concern a round in the future?
    • pastRound

      public boolean pastRound(int testRound)
      Does this SpecialHexDisplayObjet concern a round in the past?
    • getInfo

      public String getInfo()
    • setInfo

      public void setInfo(String info)
    • getRound

      public int getRound()
    • setRound

      public void setRound(int round)
    • getType

      public SpecialHexDisplay.Type getType()
    • getDefaultImage

      public Image getDefaultImage()
    • setType

      public void setType(SpecialHexDisplay.Type type)
    • getOwner

      public Player getOwner()
    • setOwner

      public void setOwner(Player owner)
    • setObscuredLevel

      public void setObscuredLevel(int o)
    • getObscuredLevel

      public int getObscuredLevel()
    • isObscured

      public boolean isObscured(@Nullable Player other)
      Determines whether this special hex should be obscured from the given Player.
      Parameters:
      other - The player to check for
      Returns:
      True if the special hex should be obscured
    • setObscured

      public void setObscured(int obscured)
    • drawNow

      public boolean drawNow(GamePhase phase, int curRound, Player playerChecking, GUIPreferences guiPref)
      Determine whether the current SpecialHexDisplay should be displayed Note Artillery Hits and Bomb Hits (direct hits on their targets) will always display in the appropriate phase. Other bomb- or artillery-related graphics are optional.
      Parameters:
      phase - The current phase of the game
      curRound - The current round
      playerChecking - The player checking the display
      guiPref - The GUI preferences
      Returns:
      True if the image should be displayed
    • isOwner

      public boolean isOwner(Player toPlayer)
      Parameters:
      toPlayer - The player to check
      Returns:
      True if the player is the owner of this Special Hex Display
    • getDriftHex

      @Nullable public Coords getDriftHex()
      Returns:
      The hex an artillery round drifted to (for a drift marker on the targeted hex), or null if this marker is not a drift
    • setDriftHex

      public void setDriftHex(@Nullable Coords driftHex)
      Records the hex an artillery round drifted to, so the board view can draw a drift line from this marker's (targeted) hex to it.
      Parameters:
      driftHex - The hex the round actually landed on, or null for no drift line
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object