public final class Ruleset
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Ruleset.ShipRules |
Modifier and Type | Field and Description |
---|---|
static FieldBound |
FIELD_BOUND |
static boolean |
SHOOT_AGAIN_AFTER_HIT |
Modifier and Type | Method and Description |
---|---|
static boolean |
isPointWithinLimits(Point2d p)
Returns
true if the point is within the limits of the boundary,
false otherwise. |
static boolean |
isShipWithinLimits(Ship ship,
Point2d point)
Returns
true if the ship is within the limits of the boundary,
false otherwise. |
public static final FieldBound FIELD_BOUND
public static final boolean SHOOT_AGAIN_AFTER_HIT
public static boolean isPointWithinLimits(Point2d p)
true
if the point is within the limits of the boundary,
false
otherwise.p
- a Point2d
true
if the point is within the limitspublic static boolean isShipWithinLimits(Ship ship, Point2d point)
true
if the ship is within the limits of the boundary,
false
otherwise. It currently works with standard direction,
EAST.ship
- Ship
point
- the starting position of the shiptrue
if the ship is within the limits of the boundary