Class RubbleClearSprite

All Implemented Interfaces:
ImageObserver, Comparable<Sprite>

public class RubbleClearSprite extends HexSprite
Displays a rubble-clearing-in-progress indicator on the hex a bulldozer vehicle is clearing (TacOps). Shows the clearing progress as text ("2/8") and fades in the matching "cleared paths" rubble artwork (saxarba/rubble_<type>_path.png) at an opacity that grows with progress, so the rubble hex is progressively replaced by the bulldozed-path version as the work nears completion. If the path image cannot be loaded it falls back to fading the hex to its exposed base-terrain colour.
  • Constructor Details

    • RubbleClearSprite

      public RubbleClearSprite(BoardView boardView, Coords loc, int turnsCompleted, int turnsRequired, boolean overlayCounter)
      Creates a new rubble-clearing sprite for the given hex.
      Parameters:
      boardView - the parent board view
      loc - the rubble hex being cleared
      turnsCompleted - the turns of clearing banked so far (the numerator)
      turnsRequired - the total turns the clearing needs (the denominator)
      overlayCounter - true to draw the progress counter over the unit; false to draw the cleared-path fade behind
  • Method Details

    • prepare

      public void prepare()
      Description copied from class: Sprite
      Do any necessary preparation. This is called after creation, but before drawing, when a device context is ready to draw with.
      Specified by:
      prepare in class Sprite
    • isBehindTerrain

      public boolean isBehindTerrain()
      Description copied from class: HexSprite
      Returns 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:
      isBehindTerrain in class HexSprite
      Returns:
      True for Sprites that should be hidden by overlapping terrain in isometric mode