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

Class games.Battle.client.ClientApplet.ClientLook

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

public class ClientLook
extends Object
ClientLook is a base class which defines the interface (and some implementation) for a set of classes used to implement the "look" of the client. By deriving a new class from ClientLook and overriding the update(b) and updateTerrain() methods, an entirely new look can be written for the client. Typically the terrain is generated once at the beginning of the game after the client has received the TerrainInit packet from the server. After that, updateTerrain() should not need to be called again. update() is called on every turn and allows all of the troops and pipes to be drawn. The original Europa client has two look classes: ClientLookArcade and ClientLookTraditional.

Variable Index

 o component
A reference to the ClientBoardComponent instance for this game board.
 o offGC
A graphics context to the offscren image.
 o offScreenImage
A reference to the ClientBoardComponent's offscreen image.
 o onGC
A graphics context to the ClientBoardComponent's drawing area.

Constructor Index

 o ClientLook(ClientBoardComponent)
Initialize the ClientLook data members.

Method Index

 o update(ClientBoard)
Abstract method redefined in subclasses to actually physically update the graphical state of the board during the game.
 o updateDisplay()
Forces the offscreen graphic to draw on the ClientBoardComponent.
 o updateTerrain(ClientBoard)
Abstract method redefined in subclasses to update the background terrain of the game board.

Variables

 o offScreenImage
  protected Image offScreenImage
A reference to the ClientBoardComponent's offscreen image.
 o offGC
  protected Graphics offGC
A graphics context to the offscren image.
 o onGC
  protected Graphics onGC
A graphics context to the ClientBoardComponent's drawing area.
 o component
  protected ClientBoardComponent component
A reference to the ClientBoardComponent instance for this game board.

Constructors

 o ClientLook
  public ClientLook(ClientBoardComponent c)
Initialize the ClientLook data members. It basically references the ClientBoardComponent's offscreen bitmap (which the look draws into) and builds a graphics context for the offscreen bitmap and the onscreen bitmap.
Parameters:
c - the ClientBoardComponent we are drawing into

Methods

 o update
  public abstract void update(ClientBoard b)
Abstract method redefined in subclasses to actually physically update the graphical state of the board during the game.
 o updateTerrain
  public abstract void updateTerrain(ClientBoard b)
Abstract method redefined in subclasses to update the background terrain of the game board.
 o updateDisplay
  public void updateDisplay()
Forces the offscreen graphic to draw on the ClientBoardComponent.

All Packages  Class Hierarchy  This Package  Previous  Next  Index