Package megamek.common.board
Record Class AllowedDeploymentHelper
java.lang.Object
java.lang.Record
megamek.common.board.AllowedDeploymentHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboard()Returns the value of theboardrecord component.coords()Returns the value of thecoordsrecord component.entity()Returns the value of theentityrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns a list of elevations/altitudes that the given entity can deploy to at the given coords.findAllowedElevations(DeploymentElevationType limitToType) Returns a list of elevations/altitudes that the given entity can deploy to at the given coords that are of the given type.findAllowedFacings(int elevation) Returns a FacingOption that indicates which facings are valid for deploying this entity at the given coordinates and elevation.game()Returns the value of thegamerecord component.final inthashCode()Returns a hash code value for this object.hex()Returns the value of thehexrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AllowedDeploymentHelper
Creates an instance of aAllowedDeploymentHelperrecord class.- Parameters:
entity- the value for theentityrecord componentcoords- the value for thecoordsrecord componentboard- the value for theboardrecord componenthex- the value for thehexrecord componentgame- the value for thegamerecord component
-
-
Method Details
-
findAllowedElevations
Returns a list of elevations/altitudes that the given entity can deploy to at the given coords. This can be anything from the seafloor, swimming, ice, water surface, ground, up to elevations and altitudes. For VTOLs, elevations up to 10 are always included individually if available. Above that and above all terrain features of the hex, only a single elevation is reported using the ELEVATIONS_ABOVE marker, meaning that any elevation above the reported value is also available. Altitudes are always reported individually (0 to 10).- Returns:
- All legal deployment elevations/altitudes
-
findAllowedElevations
Returns a list of elevations/altitudes that the given entity can deploy to at the given coords that are of the given type. This can be anything from the seafloor, swimming, ice, water surface, ground, up to elevations and altitudes. For VTOLs, elevations up to 10 are always included individually if available. Above that and above all terrain features of the hex, only a single elevation is reported using the ELEVATIONS_ABOVE marker, meaning that any elevation above the reported value is also available. Altitudes are always reported individually (0 to 10).- Returns:
- All legal deployment elevations/altitudes of the given type
-
findAllowedFacings
Returns a FacingOption that indicates which facings are valid for deploying this entity at the given coordinates and elevation. For facing-independent entities (single-hex or symmetrical multi-hex), all facings (0-5) will be valid. For facing-dependent entities (like non-symmetrical BuildingEntity), only facings where all secondary hexes are valid will be included.- Parameters:
elevation- The elevation/altitude to check- Returns:
- FacingOption containing all valid facings, or null if no facings are valid
-
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 withObjects::equals(Object,Object). -
entity
Returns the value of theentityrecord component.- Returns:
- the value of the
entityrecord component
-
coords
Returns the value of thecoordsrecord component.- Returns:
- the value of the
coordsrecord component
-
board
Returns the value of theboardrecord component.- Returns:
- the value of the
boardrecord component
-
hex
Returns the value of thehexrecord component.- Returns:
- the value of the
hexrecord component
-
game
Returns the value of thegamerecord component.- Returns:
- the value of the
gamerecord component
-