Class FireProcessor


public class FireProcessor extends DynamicTerrainProcessor
  • Constructor Details

    • FireProcessor

      public FireProcessor(TWGameManager gameManager)
  • Method Details

    • doEndPhaseChanges

      public void doEndPhaseChanges(Vector<Report> vPhaseReport)
      Description copied from class: DynamicTerrainProcessor
      Process terrain changes in the end phase
      Specified by:
      doEndPhaseChanges in class DynamicTerrainProcessor
      Parameters:
      vPhaseReport - reports for the server to send out
    • burnDownWoods

      public Vector<Report> burnDownWoods(Coords coords, Board board)
    • spreadFire

      public void spreadFire(Board board, int x, int y, WindDirection windDir, Wind windStr)
      Spreads the fire around the specified coordinates.
    • spreadFire

      public void spreadFire(Board board, Coords origin, Coords coords, TargetRoll roll, int height)
      Spreads the fire, and reports the spread, to the specified hex, if possible, if the hex isn't already on fire, and the fire roll is made.
      Parameters:
      origin - the origin coordinates
      coords - the coordinates to check to see if the fire spreads to them
      roll - the target number for roll for fire to spread
      height - the height of the origin hex
    • driftAddSmoke

      @Nullable public Coords driftAddSmoke(Coords source, Board board, WindDirection windDirection, Wind windStrength)
      Override for the main driftAddSmoke to allow for 0 direction changes
      Parameters:
      source - the source coordinates
      windDirection - the wind's direction
      windStrength - the wind's strength
      Returns:
      the coordinates where the smoke has drifted to, or null if it dissipates while on the board.
    • driftAddSmoke

      @Nullable public Coords driftAddSmoke(Coords src, Board board, WindDirection windDir, Wind windStr, int directionChanges)
      Smoke cannot climb more than 4 hexes if the next hex is more than 4 in elevation then the smoke will try to go right. If it cannot go right it'll try to go left. If it cannot go left it'll stay put.
      Parameters:
      src - the source coordinates
      windDir - the wind's direction
      windStr - the wind's strength
      directionChanges - How many times the smoke has tried to change directions to get around an obstacle.
      Returns:
      the coordinates where the smoke has drifted to, or null if it dissipates while on the board.
    • checkSmokeDissipation

      public boolean checkSmokeDissipation(SmokeCloud cloud, Wind windStr)
      Checks for the given SmokeCloud if it dissipates, either by a level or entirely and returns true if it does. This checks both dissipation by wind and by duration.
      Parameters:
      cloud - The Smoke cloud to test
      windStr - The current wind strength
      Returns:
      True when the smoke cloud dissipates by a level or entirely
    • driftSmokeReport

      public void driftSmokeReport(SmokeCloud cloud, boolean dissipated)