Record Class HexProperties

java.lang.Object
java.lang.Record
megamek.client.bot.princess.HexProperties
Record Components:
bank - the walkable-bank region id, BankRegions.WATER for water hexes
partialCover - a standing Mek in this hex has partial cover against direct fire
concealment - the terrain to-hit modifier attacks against the occupant take, 0 for open ground
concealmentEdge - concealing hex with at least one open neighbor: fire out, hard to hit, not blind
elevation - the hex level
overlooks - locally dominant height: two or more levels above the surrounding ground
heatSink - water deep enough to double an occupant's heat dissipation

public record HexProperties(int bank, boolean partialCover, int concealment, boolean concealmentEdge, int elevation, boolean overlooks, boolean heatSink) extends Record
What one hex offers a unit standing in it, expressed as rules effects rather than terrain names.

Every map is different, so no field here is a list of terrain types. Each is derived from the effect the game's own rules code computes - what the hex does to fire against its occupant, to line of sight, to heat - which is what makes a building read as concealment on a city map and rubble count the same as brush, on maps the authors never saw. The one name-specific field is water's heat sinking, because the rulebook itself is name-specific there.

Built once per board per round by HexPropertiesMap; every use afterward is one map lookup. This is the per-hex record IllianiBird proposed in the #8659 review, absorbing the walkable-bank labels that started as their own structure.

  • Constructor Summary

    Constructors
    Constructor
    Description
    HexProperties(int bank, boolean partialCover, int concealment, boolean concealmentEdge, int elevation, boolean overlooks, boolean heatSink)
    Creates an instance of a HexProperties record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the bank record component.
    int
    Returns the value of the concealment record component.
    boolean
    Returns the value of the concealmentEdge record component.
    int
    Returns the value of the elevation record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the heatSink record component.
    boolean
    Returns the value of the overlooks record component.
    boolean
    Returns the value of the partialCover record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • HexProperties

      public HexProperties(int bank, boolean partialCover, int concealment, boolean concealmentEdge, int elevation, boolean overlooks, boolean heatSink)
      Creates an instance of a HexProperties record class.
      Parameters:
      bank - the value for the bank record component
      partialCover - the value for the partialCover record component
      concealment - the value for the concealment record component
      concealmentEdge - the value for the concealmentEdge record component
      elevation - the value for the elevation record component
      overlooks - the value for the overlooks record component
      heatSink - the value for the heatSink record component
  • Method Details

    • 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.
    • bank

      public int bank()
      Returns the value of the bank record component.
      Returns:
      the value of the bank record component
    • partialCover

      public boolean partialCover()
      Returns the value of the partialCover record component.
      Returns:
      the value of the partialCover record component
    • concealment

      public int concealment()
      Returns the value of the concealment record component.
      Returns:
      the value of the concealment record component
    • concealmentEdge

      public boolean concealmentEdge()
      Returns the value of the concealmentEdge record component.
      Returns:
      the value of the concealmentEdge record component
    • elevation

      public int elevation()
      Returns the value of the elevation record component.
      Returns:
      the value of the elevation record component
    • overlooks

      public boolean overlooks()
      Returns the value of the overlooks record component.
      Returns:
      the value of the overlooks record component
    • heatSink

      public boolean heatSink()
      Returns the value of the heatSink record component.
      Returns:
      the value of the heatSink record component