Global Positioning System Reference
In-Depth Information
The object variable roApp is set internally and remains hidden to the player,
yet the player can access predefined server values, for example,
mapArea = getServerBox();
// -> LCPlayer.roApp.getServerBox()
which is basically the bounding box of the given game board for this very
special implementation.
Now, the GUIs box can be readjusted to the server box:
gui. bigMap.setGridArea( mapArea );
gui.smallMap.setGridArea( mapArea );
The button \register player" invokes
identifyPlayer()
to submit the internal (and also hidden) remote player with the desired
game role. Then, the server calls the client player back on its init method
public void init( GameSet gameSet )
{
super.init( gameSet );
createLinkArrays ( board );
createStationArrays ( board );
...
where the LCPlayer ( super ) is initialized before the overriding GUIPlayer
method retrieves the board to create all links and stations of the map.
Due to the rather preliminary design of the MapPanel , the player is forced
to manage a number of drawing arrays. Two arrays to draw the map links
private Route[] mapLinks;
private Color[] linkColors;
by predefined feature colors
private Color[] featureColors = // ( R, G, B )
{ new Color( 204,153,28), new Color( 34,141,95),
new Color( 209,13,85) };
Another simplification to the ROAF is a single map (or network) for
server, all players, and for the duration of a complete game. The arrays
can be set up with fixed lengths. An application without a defined bound-
ing box, like cars driving on interurban roads, will require a different and
dynamic approach to constantly read and buffer the map for routing and
drawing.
Two checkboxes are supplied to show or hide map links and game sta-
tions.
Before the player can enter the game scenario, the rules require him to
set his origin as the entry point. The actual variable myOrigin is defined
 
Search WWH ::




Custom Search