Package megamek.common
Class InfernoTracker
java.lang.Object
megamek.common.InfernoTracker
- All Implemented Interfaces:
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the number of hits with the given inferno round to the tracker.voidclear()Clear the effects of the inferno rounds (the unit got a bath).intDeprecated, for removal: This API element is subject to removal in a future version.intgetHeat()Determine the number of heat points generated in the current turn.intDetermine the total number of turns left for the Infernos to burn.booleanDetermine if the unit or hex still has inferno rounds that are burning.voidnewRound(int roundNumber) The infernos have burned for a round.voidsetTurnsLeftToBurn(int turnsLeftToBurn) Deprecated, for removal: This API element is subject to removal in a future version.
-
Field Details
-
STANDARD_ROUND
The hit from a standard Inferno round. -
INFERNO_IV_ROUND
The hit from an Inferno IV round. -
STANDARD_TURN
A single burn turn from a standard Inferno round. -
INFERNO_IV_TURN
A single burn turn from an Inferno IV round.
-
-
Constructor Details
-
InfernoTracker
public InfernoTracker()Create an empty tracker.
-
-
Method Details
-
add
Add the number of hits with the given inferno round to the tracker.- Parameters:
round- - theInfernoround that hits. If this value is notSTANDARD_ROUNDorINFERNO_IV_ROUND, then anIllegalArgumentExceptionwill be thrown.hits- - theintnumber of rounds that hit. If a negative number is passed, then anIllegalArgumentExceptionwill 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:
trueif there are inferno rounds that are still burning.falseif 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:
newRoundin interfaceRoundUpdated
-
getTurnsLeftToBurn
public int getTurnsLeftToBurn()Determine the total number of turns left for the Infernos to burn.- Returns:
- The
intnumber 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 theisStillBurning()method returnstrue. It will not be negative.
-
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
intnumber 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 theisStillBurning()method returnstrue. It will not be negative.
-
getHeat
public int getHeat()Determine the number of heat points generated in the current turn.- Returns:
- the
intnumber of heat points added this turn. This value will be positive whenisStillBurning()returnstrue. It will not be negative.
-
setTurnsLeftToBurn
Deprecated, for removal: This API element is subject to removal in a future version.
-