Package megamek.common.board
Class FacingOption
java.lang.Object
megamek.common.board.FacingOption
Represents the valid facings for deploying a multi-hex entity at a specific position and elevation. For
facing-dependent entities (like non-symmetrical BuildingEntity), different facings may result in different deployment
validity due to secondary hex positions being rotated.
-
Constructor Summary
ConstructorsConstructorDescriptionFacingOption(Coords position, int elevation) Creates a new FacingOption for a given position and elevation. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddValidFacing(int facing) Adds a valid facing.intGets the elevation for this facing option.Gets the position for this facing option.intGets the number of valid facings.Gets the set of valid facings (0-5) for deployment at this position and elevation.booleanChecks if any facings are valid.booleanisFacingValid(int facing) Deprecated, for removal: This API element is subject to removal in a future version.toString()
-
Constructor Details
-
FacingOption
Creates a new FacingOption for a given position and elevation.- Parameters:
position- The board coordinateselevation- The elevation/altitude
-
-
Method Details
-
getPosition
Gets the position for this facing option.- Returns:
- The board coordinates
-
getElevation
public int getElevation()Gets the elevation for this facing option.- Returns:
- The elevation/altitude
-
getValidFacings
Gets the set of valid facings (0-5) for deployment at this position and elevation.- Returns:
- Set of valid facing values
-
addValidFacing
public void addValidFacing(int facing) Adds a valid facing.- Parameters:
facing- The facing to add (0-5)
-
isFacingValid
Deprecated, for removal: This API element is subject to removal in a future version.Checks if a specific facing is valid for deployment.- Parameters:
facing- The facing to check (0-5)- Returns:
- true if this facing allows deployment
-
hasValidFacings
public boolean hasValidFacings()Checks if any facings are valid.- Returns:
- true if at least one facing is valid
-
getValidFacingCount
public int getValidFacingCount()Gets the number of valid facings.- Returns:
- Count of valid facings
-
toString
-