Class games.Battle.client.ClientApplet.ClientLookArcade
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class games.Battle.client.ClientApplet.ClientLookArcade

java.lang.Object
   |
   +----games.Battle.client.ClientApplet.ClientLook
           |
           +----games.Battle.client.ClientApplet.ClientLookArcade

public class ClientLookArcade
extends ClientLook
ClientLookArcade is a client look that uses a variety of images loaded from the client URL to simulate the contours of the landscape with shadows and hilites, assuming the light source is hitting the land from the upper left hand side of the game board. Hills look like they rise out of the landscape and valleys actually look like they sink into the landscape. ClientLookArcade implements ClientLook's abstract methods update() and updateTerrain() and adds several supporting methods.

Constructor Index

 o ClientLookArcade(ClientBoardComponent)
Construct a ClientLookArcade with the given ClientBoardComponent.

Method Index

 o getSurroundingWaterMask(Board, int, int)
Return a mask of 4 bits which give information about the water surrounding the given cell.
 o isConflict(ClientBoard, int, int, int)
Return true if there is a conflict occuring at the (r,c)-th cell.
 o update(ClientBoard)
Update the client graphics for a single turn.
 o updateTerrain(ClientBoard)
Update the background terrain image for board b.
 o waterImage(int)
Return a certain water image based on a mask.

Constructors

 o ClientLookArcade
  public ClientLookArcade(ClientBoardComponent c)
Construct a ClientLookArcade with the given ClientBoardComponent.

Methods

 o getSurroundingWaterMask
  public int getSurroundingWaterMask(Board board,
                                     int r,
                                     int c)
Return a mask of 4 bits which give information about the water surrounding the given cell. This method says: you have water to your north, south, east or west.
Parameters:
board - the board containing the cells
the - cell row
the - cell column
 o waterImage
  public Image waterImage(int mask)
Return a certain water image based on a mask. The mask represents a value returned from getSurroundingWaterMask().
Parameters:
mask - the mask on which to switch to select the image
 o updateTerrain
  public void updateTerrain(ClientBoard b)
Update the background terrain image for board b.
Parameters:
b - the board to update the terrain image for
Overrides:
updateTerrain in class ClientLook
 o isConflict
  public boolean isConflict(ClientBoard b,
                            int r,
                            int c,
                            int occ)
Return true if there is a conflict occuring at the (r,c)-th cell. This method is used in update() to indicate that two (or more) players are fighting over a cell and that some special fighting graphics and/or sounds should be employed.
Parameters:
b - the board in question
r - the row to check
c - the column to check
occ - the "friendly" occupancy value
 o update
  public void update(ClientBoard b)
Update the client graphics for a single turn. Basically goes through each cell on the board and draws troops, cities, and pipes.
Parameters:
b - the board being drawn
Overrides:
update in class ClientLook

All Packages  Class Hierarchy  This Package  Previous  Next  Index