Class BridgeBuildSprite
java.lang.Object
megamek.client.ui.clientGUI.boardview.sprite.Sprite
megamek.client.ui.clientGUI.boardview.sprite.HexSprite
megamek.client.ui.clientGUI.boardview.sprite.BridgeBuildSprite
- All Implemented Interfaces:
ImageObserver,Comparable<Sprite>
Displays a bridge-under-construction indicator on the hex where Bridge-Building Engineers are raising a bridge
(TO:AUE). Shows the finished bridge graphic for the build's orientation as a ghost image whose opacity equals the
build progress (turn 1 of 6 = 1/6 visible, the final turn fully visible), so the bridge appears piece by piece over
the course of the work, plus the progress as text ("2/6") in the lower portion of the hex.
-
Field Summary
Fields inherited from class megamek.client.ui.clientGUI.boardview.sprite.Sprite
bounds, bv, hidden, imageFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionBridgeBuildSprite(BoardView boardView, Coords location, int turnsWorked, int turnsRequired, int exits) Creates a new bridge building sprite for the given hex.BridgeBuildSprite(BoardView boardView, Coords location, int turnsWorked, int turnsRequired, int exits, boolean hazardOutline) Creates a new bridge indicator sprite, optionally ringed with a bold yellow/black hazard outline. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true when this Sprite should be hidden by overlapping terrain in isometric mode, i.e.voidprepare()Do any necessary preparation.Methods inherited from class megamek.client.ui.clientGUI.boardview.sprite.HexSprite
createNewHexImage, getPosition, updateBoundsMethods inherited from class megamek.client.ui.clientGUI.boardview.sprite.Sprite
compareTo, drawOnto, drawOnto, equals, getBounds, getSpritePriority, getTooltip, imageUpdate, isHidden, isInside, isReady, setHidden, toString
-
Constructor Details
-
BridgeBuildSprite
public BridgeBuildSprite(BoardView boardView, Coords location, int turnsWorked, int turnsRequired, int exits) Creates a new bridge building sprite for the given hex. The sprite shows how much of the bridge is currently standing, on the build'sN / build-requiredscale: a build counts this up as turns are banked, a dismantling counts the same number back down to zero.- Parameters:
boardView- the parent board viewlocation- the hex the bridge is being raised inturnsWorked- the turns of structure currently standing (0 toturnsRequired)turnsRequired- the total turns of work a finished bridge needs (the denominator)exits- exits bitmask of the two hexsides the finished bridge will connect
-
BridgeBuildSprite
public BridgeBuildSprite(BoardView boardView, Coords location, int turnsWorked, int turnsRequired, int exits, boolean hazardOutline) Creates a new bridge indicator sprite, optionally ringed with a bold yellow/black hazard outline. A short-lived indicator (such as a one-turn Bridge-Layer deployment, whose ghost is easy to overlook - colour-blind players in particular flagged it as hard to see) uses the outline so the target hex is unmistakable; the multi-turn engineer build leaves it off and relies on its growing ghost.- Parameters:
boardView- the parent board viewlocation- the hex the bridge is being raised inturnsWorked- the turns of structure currently standing (0 toturnsRequired)turnsRequired- the total turns of work a finished bridge needs (the denominator)exits- exits bitmask of the two hexsides the finished bridge will connecthazardOutline- whether to ring the hex with a high-visibility yellow/black hazard outline
-
-
Method Details
-
prepare
public void prepare()Description copied from class:SpriteDo any necessary preparation. This is called after creation, but before drawing, when a device context is ready to draw with. -
isBehindTerrain
public boolean isBehindTerrain()Description copied from class:HexSpriteReturns true when this Sprite should be hidden by overlapping terrain in isometric mode, i.e. hidden behind mountains. By default, this method returns true.- Overrides:
isBehindTerrainin classHexSprite- Returns:
- True for Sprites that should be hidden by overlapping terrain in isometric mode
-