"Regulus" design
public class BeeperHuntRuns the GUI and controls the application. This uses the default constructor.
public static void main(String[] args)Maze and a MazeView which observes the
Maze.Beeperhunt will also need to implement these GUI controls, even though they are not publicly accessible.
public class MazeView extends Container implements
ObserverDisplays the current state of the maze, including the robot and beepers. This should also show the number of beepers collected so far. This uses the default constructor.
public void update()public class Model implements ObservableThis is the simulation itself. It should be observed by a
MazeView. It holds the maze as a graph of
Nodes and keeps track of the robot and beepers within the
maze. The robot's and the beepers' behavior is determined by
advance. The manner in which this does so is
implementation-specific. For example, the robot and the beepers could
be their own objects, or they could simply be stored as references
to Nodes within the maze.
public Maze()public int countBeepers()public void advance()public Node findBeeper(int beeper) throws
IllegalArgumentExceptionbeeper. Right now,
beeper should be 1 or 2. Otherwise, an
IllegalArgumentException is thrown.public Node findRobot()public Node getMaze()public void notifyObservers()public class NodeA Node is one point in a graph. It is linked to 4
other Nodes. At least one of these must not be
null so that a graph of Nodes is always
connected. This also means that single Node mazes are
impossible.
public Iterator getIterator()Iterator which moves through this
Node's neighbors.