Class games.Battle.server.ServerBoard.ServerBoard
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class games.Battle.server.ServerBoard.ServerBoard

java.lang.Object
   |
   +----games.Battle.shared.sys.Board
           |
           +----games.Battle.server.ServerBoard.ServerBoard

public class ServerBoard
extends Board
ServerBoard extends the board to keep track of things that the server side wants to know about the game board.

Variable Index

 o maxTroops
this is the maximum number of actual troops permitted in a cell at one time.

Constructor Index

 o ServerBoard(GameReferee, Logger)
given a referee and a log file, construct a new game board.

Method Index

 o addVisibility(int, int, int)
makes the given cell and the surrounding region to the horizon visible to the given player
 o asciiDump(int)
produce debugging output
 o howMuchTime(long, String)
record how much time some action has taken.
 o isGameOver()
return true if the game has ended - that is only one player remains
 o isVisible(int, int, int)
returns true if the given row,col cell is visible to the given player
 o killPlayer(int)
kill the player given as an argument.
 o makeCell(int, int)
makes a cell for the server board
 o makeRandomTerrain()
produce terrain based on the geomorph tiles.
 o placePlayer(int)
given a player number give the player a new city on the map.
 o removeVisibility(int, int, int)
Removes visibility of adjacent cells for player assuming player just lost occupancy of the cell at row, col.
 o update()
update the board to reflect the passage of one unit of xbattle time.
 o updateCell(int, int)
update a particular cell on the game board.

Variables

 o maxTroops
  public final static int maxTroops
this is the maximum number of actual troops permitted in a cell at one time.

Constructors

 o ServerBoard
  public ServerBoard(GameReferee ref,
                     Logger logfile)
given a referee and a log file, construct a new game board.
Parameters:
ref - the referee
logfile - the log service

Methods

 o makeCell
  public Cell makeCell(int r,
                       int c)
makes a cell for the server board
Overrides:
makeCell in class Board
 o makeRandomTerrain
  public void makeRandomTerrain()
produce terrain based on the geomorph tiles.
 o placePlayer
  public void placePlayer(int player)
given a player number give the player a new city on the map.
 o addVisibility
  public void addVisibility(int row,
                            int col,
                            int player)
makes the given cell and the surrounding region to the horizon visible to the given player
Parameters:
row - the row of the cell to adjust from
col - the column of the cell to adjust from
player - the player who is now in this position
 o isVisible
  public boolean isVisible(int row,
                           int col,
                           int player)
returns true if the given row,col cell is visible to the given player
Parameters:
row - the row
col - the column
player - the player who is trying to see row, col
 o removeVisibility
  public void removeVisibility(int row,
                               int col,
                               int player)
Removes visibility of adjacent cells for player assuming player just lost occupancy of the cell at row, col. row, col can't be occupied by player, or method will not not work properly--i.e. unoccupy it first.
Parameters:
row - the row of the cell that has been vacated
col - the column of the cell that has been vacated
player - the player who is no longer in this cell
 o asciiDump
  public void asciiDump(int player)
produce debugging output
 o update
  public void update()
update the board to reflect the passage of one unit of xbattle time.
 o killPlayer
  public void killPlayer(int player)
kill the player given as an argument. allows the player to watch the whole game board until the game ends.
Parameters:
player - the player who is killed
 o isGameOver
  public boolean isGameOver()
return true if the game has ended - that is only one player remains
 o updateCell
  public void updateCell(int row,
                         int col)
update a particular cell on the game board.
 o howMuchTime
  public long howMuchTime(long oldtime,
                          String msg)
record how much time some action has taken. used to help make sure that the server can consistently meet the time goal of X ms per turn.

All Packages  Class Hierarchy  This Package  Previous  Next  Index