Class HalfPlaneHint
- java.lang.Object
-
- com.treasure.hunt.strategy.geom.HintAndMovement
-
- com.treasure.hunt.strategy.hint.Hint
-
- com.treasure.hunt.strategy.hint.impl.AngleHint
-
- com.treasure.hunt.strategy.hint.impl.HalfPlaneHint
-
public class HalfPlaneHint extends AngleHint
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HalfPlaneHint.Direction
-
Field Summary
-
Fields inherited from class com.treasure.hunt.strategy.hint.Hint
additionalGeometryItems
-
-
Constructor Summary
Constructors Constructor Description HalfPlaneHint(org.locationtech.jts.geom.Coordinate center, org.locationtech.jts.geom.Coordinate right)
HalfPlaneHint(org.locationtech.jts.geom.Coordinate center, org.locationtech.jts.geom.Coordinate right, boolean visualisation)
HalfPlaneHint(org.locationtech.jts.geom.Coordinate pointOne, org.locationtech.jts.geom.Coordinate pointTwo, HalfPlaneHint.Direction direction)
This constructor can be used when unsure whether pointOne or pointTwo is the right/left point of the hint but the direction of the hint is known.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
approximatelyInHalfPlane(org.locationtech.jts.geom.Coordinate coordinate)
org.locationtech.jts.geom.Coordinate
getCenter()
HalfPlaneHint.Direction
getDirection()
java.util.List<GeometryItem<?>>
getGeometryItems()
org.locationtech.jts.geom.LineSegment
getHalfPlaneLine()
org.locationtech.jts.geom.LineString
getHalfPlaneLineString()
HalfPlane
getHalfPlaneTheTreasureIsNotIn()
org.locationtech.jts.geom.Coordinate
getLeft()
org.locationtech.jts.geom.Coordinate
getLowerHintPoint()
Returns either the center or the right point The point with the lower y value gets returned.org.locationtech.jts.geom.Coordinate
getRight()
org.locationtech.jts.geom.Coordinate
getUpperHintPoint()
Returns either the center or the right point The point with the higher y value gets returned.boolean
inHalfPlane(org.locationtech.jts.geom.Coordinate coordinate)
boolean
pointsDownwards()
boolean
pointsUpwards()
-
Methods inherited from class com.treasure.hunt.strategy.hint.impl.AngleHint
getGeometryAngle
-
Methods inherited from class com.treasure.hunt.strategy.hint.Hint
addAdditionalItem, canEqual, equals, getAdditionalGeometryItems, hashCode, toString
-
Methods inherited from class com.treasure.hunt.strategy.geom.HintAndMovement
getStatusMessageItemsToBeAdded, getStatusMessageItemsToBeRemoved
-
-
-
-
Constructor Detail
-
HalfPlaneHint
public HalfPlaneHint(org.locationtech.jts.geom.Coordinate center, org.locationtech.jts.geom.Coordinate right, boolean visualisation)
-
HalfPlaneHint
public HalfPlaneHint(org.locationtech.jts.geom.Coordinate center, org.locationtech.jts.geom.Coordinate right)
-
HalfPlaneHint
public HalfPlaneHint(org.locationtech.jts.geom.Coordinate pointOne, org.locationtech.jts.geom.Coordinate pointTwo, HalfPlaneHint.Direction direction)
This constructor can be used when unsure whether pointOne or pointTwo is the right/left point of the hint but the direction of the hint is known.
-
-
Method Detail
-
getDirection
public HalfPlaneHint.Direction getDirection()
-
getCenter
public org.locationtech.jts.geom.Coordinate getCenter()
-
getRight
public org.locationtech.jts.geom.Coordinate getRight()
-
getLeft
public org.locationtech.jts.geom.Coordinate getLeft()
-
getHalfPlaneTheTreasureIsNotIn
public HalfPlane getHalfPlaneTheTreasureIsNotIn()
-
getHalfPlaneLine
public org.locationtech.jts.geom.LineSegment getHalfPlaneLine()
-
getHalfPlaneLineString
public org.locationtech.jts.geom.LineString getHalfPlaneLineString()
-
inHalfPlane
public boolean inHalfPlane(org.locationtech.jts.geom.Coordinate coordinate)
-
approximatelyInHalfPlane
public boolean approximatelyInHalfPlane(org.locationtech.jts.geom.Coordinate coordinate)
-
getGeometryItems
public java.util.List<GeometryItem<?>> getGeometryItems()
- Overrides:
getGeometryItems
in classAngleHint
- Returns:
-
getLowerHintPoint
public org.locationtech.jts.geom.Coordinate getLowerHintPoint()
Returns either the center or the right point The point with the lower y value gets returned.
-
getUpperHintPoint
public org.locationtech.jts.geom.Coordinate getUpperHintPoint()
Returns either the center or the right point The point with the higher y value gets returned.
-
pointsUpwards
public boolean pointsUpwards()
- Returns:
- true if the treasure is above this hints line, false otherwise
-
pointsDownwards
public boolean pointsDownwards()
- Returns:
- true if the treasure is below this hints line, false otherwise
-
-