Class InfernoTracker

java.lang.Object
megamek.common.InfernoTracker
All Implemented Interfaces:
Serializable, RoundUpdated

public class InfernoTracker extends Object implements Serializable, RoundUpdated
This class records and defines the effects of hits by Inferno rounds on units and hexes. It does not *apply* the effect, it just defines it.

It makes use of an inner class to define an Inferno round. This inner class should not be directly accessed, but instead referred to by the constants: STANDARD_ROUND and INFERNO_IV_ROUND.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Inferno
    The hit from an Inferno IV round.
    static final Inferno
    A single burn turn from an Inferno IV round.
    static final Inferno
    The hit from a standard Inferno round.
    static final Inferno
    A single burn turn from a standard Inferno round.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create an empty tracker.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(Inferno round, int hits)
    Add the number of hits with the given inferno round to the tracker.
    void
    Clear the effects of the inferno rounds (the unit got a bath).
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    int
    Determine the number of heat points generated in the current turn.
    int
    Determine the total number of turns left for the Infernos to burn.
    boolean
    Determine if the unit or hex still has inferno rounds that are burning.
    void
    newRound(int roundNumber)
    The infernos have burned for a round.
    void
    setTurnsLeftToBurn(int turnsLeftToBurn)
    Deprecated, for removal: This API element is subject to removal in a future version.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • STANDARD_ROUND

      public static final Inferno STANDARD_ROUND
      The hit from a standard Inferno round.
    • INFERNO_IV_ROUND

      public static final Inferno INFERNO_IV_ROUND
      The hit from an Inferno IV round.
    • STANDARD_TURN

      public static final Inferno STANDARD_TURN
      A single burn turn from a standard Inferno round.
    • INFERNO_IV_TURN

      public static final Inferno INFERNO_IV_TURN
      A single burn turn from an Inferno IV round.
  • Constructor Details

    • InfernoTracker

      public InfernoTracker()
      Create an empty tracker.
  • Method Details

    • add

      public void add(Inferno round, int hits)
      Add the number of hits with the given inferno round to the tracker.
      Parameters:
      round - - the Inferno round that hits. If this value is not STANDARD_ROUND or INFERNO_IV_ROUND, then an IllegalArgumentException will be thrown.
      hits - - the int number of rounds that hit. If a negative number is passed, then an IllegalArgumentException will be thrown.
    • clear

      public void clear()
      Clear the effects of the inferno rounds (the unit got a bath).
    • isStillBurning

      public boolean isStillBurning()
      Determine if the unit or hex still has inferno rounds that are burning.
      Returns:
      true if there are inferno rounds that are still burning. false if no inferno rounds have hit yet, or if they have burned out.
    • newRound

      public void newRound(int roundNumber)
      The infernos have burned for a round.
      Specified by:
      newRound in interface RoundUpdated
    • getTurnsLeftToBurn

      public int getTurnsLeftToBurn()
      Determine the total number of turns left for the Infernos to burn.
      Returns:
      The int number of turns that this unit or hex will suffer the effects of an Inferno round (either standard or Inferno IV). This number will be positive when the isStillBurning() method returns true. It will not be negative.
    • getArrowIVTurnsLeftToBurn

      @Deprecated(since="0.51.0", forRemoval=true) public int getArrowIVTurnsLeftToBurn()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Determine just the number of turns left for Arrow IV Infernos to burn.
      Returns:
      The int number of turns that this unit or hex will suffer the effects of an Inferno IV round (ignore any standard inferno rounds). This number will be positive when the isStillBurning() method returns true. It will not be negative.
    • getHeat

      public int getHeat()
      Determine the number of heat points generated in the current turn.
      Returns:
      the int number of heat points added this turn. This value will be positive when isStillBurning() returns true. It will not be negative.
    • setTurnsLeftToBurn

      @Deprecated(since="0.51.0", forRemoval=true) public void setTurnsLeftToBurn(int turnsLeftToBurn)
      Deprecated, for removal: This API element is subject to removal in a future version.