org.starhope.appius.user
Class PathFinder

java.lang.Object
  extended by org.starhope.appius.user.PathFinder

public class PathFinder
extends Object

WRITEME: Document this type.

Author:
brpocock@star-hope.org

Nested Class Summary
 class PathFinder.ContinuePathRunner
          WRITEME: Document this type.
 
Field Summary
private  Kalendor kalendor
          WRITEME: Document this brpocock@star-hope.org
private static int PATH_TRIES
          Try so many times to find a random point that just so happens to make a path to an unreachable point
private  long timedEvent
          WRITEME: Document this brpocock@star-hope.org
private  AbstractUser user
          who is lost?
 
Constructor Summary
PathFinder(AbstractUser newUser)
          WRITEME: Document this constructor brpocock@star-hope.org
 
Method Summary
 List<String> findPathSolution(String to, List<String> visited, String nextHop)
          WRITEME: Document this method brpocock@star-hope.org
 List<String> findPathsTo(String from, String to)
          WRITEME: Document this method brpocock@star-hope.org
 String getRoomToward(String room)
          WRITEME: Document this method brpocock@star-hope.org
 boolean pathTo(Coord3D target)
          Take a step toward the target.
 boolean seekRoom(Room r)
           
 void stop()
          stop any planned movements into the future
 void takei(Coord3D target)
          Plot a course, Mr Sulu
 long whenAtTarget(Runnable runnable)
          Perform some action when the current movement-target position has been reached
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

user

private final AbstractUser user
who is lost?


PATH_TRIES

private static final int PATH_TRIES
Try so many times to find a random point that just so happens to make a path to an unreachable point

See Also:
Constant Field Values

timedEvent

private long timedEvent
WRITEME: Document this brpocock@star-hope.org


kalendor

private final Kalendor kalendor
WRITEME: Document this brpocock@star-hope.org

Constructor Detail

PathFinder

public PathFinder(AbstractUser newUser)
WRITEME: Document this constructor brpocock@star-hope.org

Parameters:
newUser - user
Method Detail

findPathSolution

public List<String> findPathSolution(String to,
                                     List<String> visited,
                                     String nextHop)
WRITEME: Document this method brpocock@star-hope.org

Parameters:
to - WRITEME
visited - WRITEME
nextHop - WRITEME
Returns:
WRITEME

findPathsTo

public List<String> findPathsTo(String from,
                                String to)
WRITEME: Document this method brpocock@star-hope.org

Parameters:
from - moniker from which to travel
to - moniker to which to travel
Returns:
shortest path (by number of links)

getRoomToward

public String getRoomToward(String room)
WRITEME: Document this method brpocock@star-hope.org

Parameters:
room - WRITEME
Returns:
WRITEME

pathTo

public boolean pathTo(Coord3D target)
Take a step toward the target. Might make an intermediate step; keep calling until it returns true.

Parameters:
target - the goal
Returns:
true, if the current walk should bring us to the target; false, if more steps are needed

seekRoom

public boolean seekRoom(Room r)
Parameters:
r - the room to seek
Returns:
true, if we're in the room.

stop

public void stop()
stop any planned movements into the future


takei

public void takei(Coord3D target)
Plot a course, Mr Sulu

Parameters:
target - second star to the right

whenAtTarget

public long whenAtTarget(Runnable runnable)
Perform some action when the current movement-target position has been reached

Parameters:
runnable - what to do when the target position is (or at least, should have been) reached
Returns:
the handle to the event, in case it's needed to cancel it
See Also:
Kalendor.schedule(long, Runnable), Kalendor.cancel(long), Geometry.getTimeToTarget(AbstractUser, long)