Class games.Battle.shared.comm.TerrainInit
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class games.Battle.shared.comm.TerrainInit

java.lang.Object
   |
   +----games.Battle.shared.comm.BattlePacket
           |
           +----games.Battle.shared.comm.TerrainInit

public class TerrainInit
extends BattlePacket
The TerrainInit packet is sent to each client prior to the start of each game, and represents the terrain of the entire game board. This is somewhat unfortunate, since this means a rewritten client could take advantage of this information and always make the terrain visible. However, I have yet to be convinced that sending terrain information in every game turn is a good idea.

Constructor Index

 o TerrainInit(Board)
Builds a terrain initializer for a particular board.

Method Index

 o fromBytes(byte[])
Fill a board with the terrain initialization data in the buffer.
 o toBytes()
Produce an array of bytes representing a terrain init

Constructors

 o TerrainInit
  public TerrainInit(Board board)
Builds a terrain initializer for a particular board.
Parameters:
board - the game board from which the init data will be read/written

Methods

 o toBytes
  public byte[] toBytes()
Produce an array of bytes representing a terrain init
Overrides:
toBytes in class BattlePacket
 o fromBytes
  public void fromBytes(byte buffer[])
Fill a board with the terrain initialization data in the buffer.
Parameters:
buffer - the terrain initialization data
Overrides:
fromBytes in class BattlePacket

All Packages  Class Hierarchy  This Package  Previous  Next  Index