Record Class Sensor

java.lang.Object
java.lang.Record
megamek.common.equipment.Sensor
All Implemented Interfaces:
Serializable

public record Sensor(int type) extends Record implements Serializable
This class will hold all the information about a particular active sensor, including its rolls
See Also:
  • Field Details

  • Constructor Details

    • Sensor

      public Sensor(int type)
      Constructor
  • Method Details

    • getDisplayName

      public String getDisplayName()
    • isBAP

      public boolean isBAP()
    • getRangeByBracket

      public int getRangeByBracket()
    • adjustRange

      public int adjustRange(int range, Game game, LosEffects los)
    • getModsForStealth

      public int getModsForStealth(Entity te)
    • getModForECM

      public int getModForECM(Entity en, List<ECMInfo> allECMInfo)
      Computes the sensor check modifier for ECM.
      Parameters:
      allECMInfo - A collection of ECMInfo for all entities, this value can be null, and it will be computed when it's needed, however passing in the pre-computed collection is much faster
    • getModForTargetECM

      public int getModForTargetECM(Entity targetEntity, List<ECMInfo> allECMInfo)
      Computes the sensor check modifier for ECM.
      Parameters:
      allECMInfo - A collection of ECMInfo for all entities, this value can be null, and it will be computed when it's needed, however passing in the pre-computed collection is much faster
    • getECMSensorRangeModifier

      public int getECMSensorRangeModifier(ECMInfo ecmInfo)
    • getModForMetalContent

      public int getModForMetalContent(Entity en, Entity te)
    • entityAdjustments

      public int entityAdjustments(int range, Entity target, Game game)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • type

      public int type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component