Class DamageEditSpec

java.lang.Object
megamek.common.units.DamageEditSpec
All Implemented Interfaces:
Serializable

public class DamageEditSpec extends Object implements Serializable
The damage editor's edits as plain values, detached from the dialog that collected them. The dialog builds one of these from its controls and either applies it to its local unit (in the lobby, or outside a game as in MekHQ) or sends it to the server, which applies it to its own authoritative copy of the unit. Sending the values instead of the edited unit keeps the server's copy authoritative: a full unit sent back from a client carries whatever stale state the client held, which has to be guarded against field by field.

A field is null when the dialog had nothing to edit for it, mirroring the dialog's controls: a unit without rear armor has no rear armor values, and only a gamemaster's in-game editor has skill modifier values. The maps are always present and empty when there is nothing in them.

This class only travels inside packets and is never written to a save, so it stays a plain Serializable class with no XStream concerns.

See Also:
  • Field Details

    • CONVERSION_GEAR_INDEX

      public static final int CONVERSION_GEAR_INDEX
      Where a QuadVee's conversion gear sits in its leg's actuator values, after the hip to foot actuators.
      See Also:
    • entityId

      public int entityId
      The unit these edits apply to.
    • internal

      public Integer[] internal
    • armor

      public Integer[] armor
    • rearArmor

      public Integer[] rearArmor
    • crewHits

      public Integer[] crewHits
      Hits taken by each crew member; the entry of a missing crew member stays null.
    • heat

      public Integer heat
      The unit's current heat, for the unit types that track it.
    • shutdown

      public Boolean shutdown
    • prone

      public Boolean prone
    • hullDown

      public Boolean hullDown
    • hidden

      public Boolean hidden
    • stealth

      public Boolean stealth
    • dugIn

      public Boolean dugIn
    • fuel

      public Integer fuel
      The fuel left in an aero.
    • ammoShots

      public final Map<Integer,Integer> ammoShots
      The shots left in each ammo bin, by its equipment number. Only a gamemaster edits these.
    • equipmentHits

      public final Map<Integer,Integer> equipmentHits
      The crit hits on each piece of equipment, by its equipment number.
    • mgBurst

      public final Map<Integer,Boolean> mgBurst
      Burst fire on each machine gun, by its equipment number; only carried by a gamemaster's in-game edit.
    • hotLoadedAmmo

      public final Map<Integer,Boolean> hotLoadedAmmo
      Hot-loading on each ammo bin, by its equipment number; only carried by a gamemaster's in-game edit.
    • equipmentMode

      public final Map<Integer,String> equipmentMode
      The chosen mode of each piece of equipment with modes, by its equipment number as the internal (non-localized) mode name; only carried by a gamemaster's in-game edit. The gamemaster's mode change takes effect at once, without the End Phase wait of a player's declared switch, and a mode matching the equipment's current mode is left alone so that a player's pending switch on untouched equipment survives the edit.
    • equipmentCharged

      public final Map<Integer,Boolean> equipmentCharged
      Whether each chargeable weapon (a bombast laser or a PPC capacitor) holds a full charge, by its equipment number; only carried by a gamemaster's in-game edit.
    • buildingStunnedTurns

      public Integer buildingStunnedTurns
      Turns the building's gunners remain stunned, or null when the unit has no such state. Zero means the gunners can act.
    • buildingGunnersKilled

      public final Map<Integer,Boolean> buildingGunnersKilled
      Whether the gunners of each of the building's hexes are dead, keyed by one entity location in that hex. Gunners are killed a hex at a time, so any location of the hex stands for the whole hex.
    • buildingTurretLocked

      public final Map<Integer,Boolean> buildingTurretLocked
      Whether each of the building's turreted weapons is locked to the forward arc, by its equipment number.
    • buildingWeaponJammed

      public final Map<Integer,Boolean> buildingWeaponJammed
      Whether each of the building's weapons is jammed, by its equipment number.
    • buildingPowerSwitchedOff

      public Boolean buildingPowerSwitchedOff
      Whether the building's power is switched off at the mains, or null when the unit has no such switch. A structure switched off shuts down however healthy its generators are.
    • gunneryModifier

      public Integer gunneryModifier
    • gunneryRounds

      public Integer gunneryRounds
    • gunneryPermanent

      public boolean gunneryPermanent
    • pilotingModifier

      public Integer pilotingModifier
    • pilotingRounds

      public Integer pilotingRounds
    • pilotingPermanent

      public boolean pilotingPermanent
    • initiativeModifier

      public Integer initiativeModifier
    • initiativeRounds

      public Integer initiativeRounds
    • initiativePermanent

      public boolean initiativePermanent
    • centerEngineHits

      public Integer centerEngineHits
    • leftEngineHits

      public Integer leftEngineHits
    • rightEngineHits

      public Integer rightEngineHits
    • gyroHits

      public Integer gyroHits
    • sensorHits

      public Integer sensorHits
    • lifeSupportHits

      public Integer lifeSupportHits
    • cockpitHits

      public Integer cockpitHits
    • lamAvionicsHits

      public final Map<Integer,Integer> lamAvionicsHits
      A land-air Mek's avionics crit hits, by location.
    • lamLandingGearHits

      public final Map<Integer,Integer> lamLandingGearHits
      A land-air Mek's landing gear crit hits, by location.
    • actuatorHits

      public Integer[][] actuatorHits
      Actuator crit hits by limb and actuator, in the damage editor's layout: the first index counts limbs from Mek.LOC_RIGHT_ARM, the second counts actuators from the shoulder (arms) or hip (legs and quads), with a QuadVee's conversion gear after the foot.
    • engineHits

      public Integer engineHits
    • turretLockHits

      public Integer turretLockHits
    • motiveHits

      public Integer motiveHits
    • stabilizerHits

      public Integer[] stabilizerHits
      Per-location stabilizer crit hits; a null element means that location has no stabilizer to edit.
    • flightStabilizerHits

      public Integer flightStabilizerHits
      A VTOL's flight stabilizer crit hits.
    • avionicsHits

      public Integer avionicsHits
    • fcsHits

      public Integer fcsHits
    • cicHits

      public Integer cicHits
    • gearHits

      public Integer gearHits
    • leftThrusterHits

      public Integer leftThrusterHits
    • rightThrusterHits

      public Integer rightThrusterHits
    • kfBoomHits

      public Integer kfBoomHits
    • dockCollarHits

      public Integer dockCollarHits
    • gravDeckHits

      public Integer gravDeckHits
    • bayCapacityRemaining

      public Double[] bayCapacityRemaining
      The undamaged capacity left in each transport bay, in the order the unit lists its bays.
    • bayDoorHits

      public Integer[] bayDoorHits
      Crit hits on each transport bay's doors, in the same order as bayCapacityRemaining.
    • workingDockingCollars

      public Integer workingDockingCollars
      How many of a Jumpship's docking collars are still working.
    • kfIntegrity

      public Integer kfIntegrity
      A Jumpship's K-F drive integrity.
    • chargingSystemHits

      public Integer chargingSystemHits
    • driveCoilHits

      public Integer driveCoilHits
    • driveControllerHits

      public Integer driveControllerHits
    • fieldInitiatorHits

      public Integer fieldInitiatorHits
    • heliumTankHits

      public Integer heliumTankHits
    • lfBatteryHits

      public Integer lfBatteryHits
    • sailIntegrity

      public Integer sailIntegrity
      A Jumpship's jump sail integrity.
    • protoHits

      public Integer[] protoHits
      A ProtoMek's per-location system crit hits.
  • Constructor Details

    • DamageEditSpec

      public DamageEditSpec()