TOC - prev - next - javadoc tree

4.2. Loading

Loading Strategies

The Strategies to be used in the game of BusRider are specified in the Applet's html-code. Look for this line:

       <PARAM NAME=strategies VALUE="...">
   
The Strategies are listed within quotes, separated by spaces, and put after the VALUE keyword. (There are other VALUE keywords; you want the one beside NAME=strategies.)

A packaged Strategy would be specified with its full name, package.Classname; unpackaged Strategies have just the class name. A particular Strategy can appear any number of times. I suppose a game should have three to eight players, but any number will do.

A Strategy must implement the busrider.Strategy interface, and have a default constuctor. Otherwise it won't compile, or won't load.

The game applet loads each player's Strategy once, even though it may play many games.

Loading the Board

The Board to be used in the game of BusRider is specified in the Applet's html-code. Look for this line:

       <PARAM NAME=board VALUE=...>
   
The Board's file name goes after the VALUE keyword. (There are other VALUE keywords; you want the one beside NAME=board.)

One can make one's own board file, and substitute it. If malformed, the Applet prints error messages to the Java console, and refuses to play. The Applet does not check whether the graph of Junctions and Segments is connected; if not, only one connected-set will actually be used in the game. (Is this a feature or a bug?)


TOC - prev - next - javadoc tree