Class RandomVroomba

java.lang.Object
  extended by Vroomba
      extended by RandomVroomba

public class RandomVroomba
extends Vroomba

This Vroomba doesn't even look at its surroundings; it just moves in a random direction each turn, even if this will result in a collision or drop. However, it never chooses Direction.HERE, and so it will never stop of its own accord.

Author:
Zach Tomaszewski
See Also:
Vroomba

Constructor Summary
RandomVroomba()
           
 
Method Summary
 Direction move(char[] s)
          Provides this Vroomba its current surroundings and asks it to choose a direction to move.
 
Methods inherited from class Vroomba
reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomVroomba

public RandomVroomba()
Method Detail

move

public Direction move(char[] s)
Description copied from class: Vroomba
Provides this Vroomba its current surroundings and asks it to choose a direction to move.

The surroundings should contain 8 entries, for surroundings[Direction.N.ordinal()], surroundings[Direction.NE.ordinal()], surroundings[Direction.E.ordinal()], ... surroundings[Direction.NW.ordinal()]. Each character contained should be a valid feature of a Room.

This Vroomba will then return the Direction it would like to move. If it no longer wishes to move (usually because it believes its containing Room is clean), it may return Direction.HERE to stop.

This behavior will depend on the overriding performed by any specific, extending Vroomba. This default Vroomba always returns Direction.HERE.

Overrides:
move in class Vroomba