Package megamek.common
Class SpecialHexDisplay
java.lang.Object
megamek.common.SpecialHexDisplay
- All Implemented Interfaces:
Serializable
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringMarks a heat-map control token's kind as a hex this turn's plan is firing at (drawn as a crosshair icon).static final StringMarks a heat-map control token's kind as a predicted enemy position (drawn as a cold-to-hot color fill).static final StringPrefix marking a bot artillery heat-map testing marker.static final intstatic intstatic intEveryone can see this displaystatic intOnly the owner may see this displaystatic intThe owner and members of his team can see this display -
Constructor Summary
ConstructorsConstructorDescriptionSpecialHexDisplay(SpecialHexDisplay.Type type, int round, Player owner, String info) SpecialHexDisplay(SpecialHexDisplay.Type type, int round, Player owner, String info, int obscured) SpecialHexDisplay(SpecialHexDisplay.Type type, int round, Player owner, String info, int obscured, String imageSignature) -
Method Summary
Modifier and TypeMethodDescriptionstatic SpecialHexDisplaycreateArtyAutoHit(Player owner) Creates an Artillery Auto hit marker for the given player.static SpecialHexDisplaycreateArtyMiss(Player owner, int round, String message) Creates an Artillery miss marker for the given owner and the given round in which it landed.static SpecialHexDisplaycreateIncomingArty(Player owner, int landingGameRound) Deprecated, for removal: This API element is subject to removal in a future version.static SpecialHexDisplaycreateIncomingFire(Player owner, int landingGameRound, String message) Creates an Incoming Artillery marker for the given owner and the given round in which it will land.booleandrawNow(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.booleanbooleanfutureRound(int testRound) Does this SpecialHexDisplayObjet concern a round in the future?getInfo()intgetOwner()intgetRound()getType()inthashCode()booleanisObscured(Player other) Determines whether this special hex should be obscured from the givenPlayer.booleanbooleanpastRound(int testRound) Does this SpecialHexDisplayObjet concern a round in the past?voidsetDriftHex(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.voidvoidsetObscured(int obscured) voidsetObscuredLevel(int o) voidvoidsetRound(int round) voidbooleanthisRound(int testRound) toString()
-
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_OWNEROnly the owner may see this display -
SHD_VISIBLE_TO_TEAM
public static int SHD_VISIBLE_TO_TEAMThe owner and members of his team can see this display -
SHD_VISIBLE_TO_ALL
public static int SHD_VISIBLE_TO_ALLEveryone can see this display -
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
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
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
-
SpecialHexDisplay
-
SpecialHexDisplay
public SpecialHexDisplay(SpecialHexDisplay.Type type, int round, Player owner, String info, int obscured) -
SpecialHexDisplay
public SpecialHexDisplay(SpecialHexDisplay.Type type, int round, Player owner, String info, int obscured, String imageSignature)
-
-
Method Details
-
createArtyAutoHit
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
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 attackround- The game round in which the attack landed and scatteredmessage- 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
-
setInfo
-
getRound
public int getRound() -
setRound
public void setRound(int round) -
getType
-
getDefaultImage
-
setType
-
getOwner
-
setOwner
-
setObscuredLevel
public void setObscuredLevel(int o) -
getObscuredLevel
public int getObscuredLevel() -
isObscured
Determines whether this special hex should be obscured from the givenPlayer.- 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 gamecurRound- The current roundplayerChecking- The player checking the displayguiPref- The GUI preferences- Returns:
- True if the image should be displayed
-
isOwner
- Parameters:
toPlayer- The player to check- Returns:
- True if the player is the owner of this Special Hex Display
-
getDriftHex
- Returns:
- The hex an artillery round drifted to (for a drift marker on the targeted hex), or
nullif this marker is not a drift
-
setDriftHex
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, ornullfor no drift line
-
equals
-
hashCode
public int hashCode() -
toString
-