Class RandomCircleHintHider
- java.lang.Object
-
- com.treasure.hunt.strategy.hider.impl.RandomCircleHintHider
-
- All Implemented Interfaces:
Hider<CircleHint>
public class RandomCircleHintHider extends java.lang.Object implements Hider<CircleHint>
This kind ofHider
gives a randomly placed and randomly sized validCircleHint
.
-
-
Constructor Summary
Constructors Constructor Description RandomCircleHintHider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.locationtech.jts.geom.Point
getTreasureLocation()
void
init(org.locationtech.jts.geom.Point searcherStartPosition)
CircleHint
move(SearchPath searchPath)
If it is the first time, aCircleHint
is requested, this returns a randomCircleHint
with a centerCoordinate
lying in [-MAX_X,MAX_X)x[-MAX_Y,MAX_Y), with a radius being of [length ((0,0),(x,y)), MAX_RADIUS).
-
-
-
Method Detail
-
init
public void init(org.locationtech.jts.geom.Point searcherStartPosition)
- Specified by:
init
in interfaceHider<CircleHint>
- Parameters:
searcherStartPosition
- theSearcher
starting position, he will initialized on.
-
move
public CircleHint move(SearchPath searchPath)
If it is the first time, aCircleHint
is requested, this returns a randomCircleHint
with a centerCoordinate
lying in [-MAX_X,MAX_X)x[-MAX_Y,MAX_Y), with a radius being of [length ((0,0),(x,y)), MAX_RADIUS).If it is not the first time, a
CircleHint
is requested, this returns a randomCircleHint
with a center lying in the previous givenCircleHint
with a valid radius.- Specified by:
move
in interfaceHider<CircleHint>
- Parameters:
searchPath
- theSearchPath
, theSearcher
did last- Returns:
- randomly generated circle
-
getTreasureLocation
public org.locationtech.jts.geom.Point getTreasureLocation()
- Specified by:
getTreasureLocation
in interfaceHider<CircleHint>
- Returns:
- the current treasure location
-
-