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 ofHidergives 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.PointgetTreasureLocation()voidinit(org.locationtech.jts.geom.Point searcherStartPosition)CircleHintmove(SearchPath searchPath)If it is the first time, aCircleHintis requested, this returns a randomCircleHintwith a centerCoordinatelying 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:
initin interfaceHider<CircleHint>- Parameters:
searcherStartPosition- theSearcherstarting position, he will initialized on.
-
move
public CircleHint move(SearchPath searchPath)
If it is the first time, aCircleHintis requested, this returns a randomCircleHintwith a centerCoordinatelying 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
CircleHintis requested, this returns a randomCircleHintwith a center lying in the previous givenCircleHintwith a valid radius.- Specified by:
movein interfaceHider<CircleHint>- Parameters:
searchPath- theSearchPath, theSearcherdid last- Returns:
- randomly generated circle
-
getTreasureLocation
public org.locationtech.jts.geom.Point getTreasureLocation()
- Specified by:
getTreasureLocationin interfaceHider<CircleHint>- Returns:
- the current treasure location
-
-