Package megamek.client.bot.princess
Record Class HexProperties
java.lang.Object
java.lang.Record
megamek.client.bot.princess.HexProperties
- Record Components:
bank- the walkable-bank region id,BankRegions.WATERfor water hexespartialCover- a standing Mek in this hex has partial cover against direct fireconcealment- the terrain to-hit modifier attacks against the occupant take, 0 for open groundconcealmentEdge- concealing hex with at least one open neighbor: fire out, hard to hit, not blindelevation- the hex leveloverlooks- locally dominant height: two or more levels above the surrounding groundheatSink- 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
ConstructorsConstructorDescriptionHexProperties(int bank, boolean partialCover, int concealment, boolean concealmentEdge, int elevation, boolean overlooks, boolean heatSink) Creates an instance of aHexPropertiesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintbank()Returns the value of thebankrecord component.intReturns the value of theconcealmentrecord component.booleanReturns the value of theconcealmentEdgerecord component.intReturns the value of theelevationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanheatSink()Returns the value of theheatSinkrecord component.booleanReturns the value of theoverlooksrecord component.booleanReturns the value of thepartialCoverrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
HexProperties
public HexProperties(int bank, boolean partialCover, int concealment, boolean concealmentEdge, int elevation, boolean overlooks, boolean heatSink) Creates an instance of aHexPropertiesrecord class.- Parameters:
bank- the value for thebankrecord componentpartialCover- the value for thepartialCoverrecord componentconcealment- the value for theconcealmentrecord componentconcealmentEdge- the value for theconcealmentEdgerecord componentelevation- the value for theelevationrecord componentoverlooks- the value for theoverlooksrecord componentheatSink- the value for theheatSinkrecord component
-
-
Method Details
-
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. -
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. -
equals
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 '=='. -
bank
public int bank()Returns the value of thebankrecord component.- Returns:
- the value of the
bankrecord component
-
partialCover
public boolean partialCover()Returns the value of thepartialCoverrecord component.- Returns:
- the value of the
partialCoverrecord component
-
concealment
public int concealment()Returns the value of theconcealmentrecord component.- Returns:
- the value of the
concealmentrecord component
-
concealmentEdge
public boolean concealmentEdge()Returns the value of theconcealmentEdgerecord component.- Returns:
- the value of the
concealmentEdgerecord component
-
elevation
public int elevation()Returns the value of theelevationrecord component.- Returns:
- the value of the
elevationrecord component
-
overlooks
public boolean overlooks()Returns the value of theoverlooksrecord component.- Returns:
- the value of the
overlooksrecord component
-
heatSink
public boolean heatSink()Returns the value of theheatSinkrecord component.- Returns:
- the value of the
heatSinkrecord component
-