Package megamek.common.hexarea
Class HalfPlaneHexArea
java.lang.Object
megamek.common.hexarea.HalfPlaneHexArea
- All Implemented Interfaces:
Serializable
,HexArea
This class represents a half plane shape. The plane is delimited by the given coordinate, which is either a hex column or row (x or y)
depending on the halfPlaneDirection given. A half plane with coordinate 5 and direction ABOVE extends from Coords (x, 5) upwards, i.e.
(0, 0) is within that plane, (0, 10) is not. The given coordinate itself is part of the half plane.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface megamek.common.hexarea.HexArea
EMPTY_AREA
-
Constructor Summary
ConstructorsConstructorDescriptionHalfPlaneHexArea
(int coordinate, HalfPlaneHexArea.HalfPlaneType halfPlaneDirection) Creates a half plane shape. -
Method Summary
-
Constructor Details
-
HalfPlaneHexArea
Creates a half plane shape. The plane is delimited by the given coordinate, which is either a hex column or row (x or y) depending on the halfPlaneDirection given. A half plane with coordinate 5 and direction ABOVE extends from Coords (x, 5) upwards, i.e. (0, 0) is within that plane, (0, 10) is not. The given coordinate itself is part of the half plane.- Parameters:
coordinate
- The x or y value where the half plane starts/endshalfPlaneDirection
- The direction in which the half plane extends
-
-
Method Details
-
containsCoords
Description copied from interface:HexArea
Returns true if this shape contains the given coords. Returns false when the given coords is null. If this shape is absolute, i.e. does not depend on parameters outside itself, the board does not matter. Some shapes however may be relative to the board size, e.g. a shape that returns the borders of the board; or even board contents, such as terrain.- Parameters:
coords
- The coords that are tested if they are part of this shapeboard
- The board to limit the area coords to- Returns:
- True if this shape contains the coords
-
getCoords
Description copied from interface:HexArea
Returns a set of the coords of this area that are part of the given board.
-