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.
-
maxTroops
- this is the maximum number of actual troops permitted in
a cell at one time.
-
ServerBoard(GameReferee, Logger)
- given a referee and a log file, construct a new game board.
-
addVisibility(int, int, int)
- makes the given cell and the surrounding region to the
horizon visible to the given player
-
asciiDump(int)
- produce debugging output
-
howMuchTime(long, String)
- record how much time some action has taken.
-
isGameOver()
- return true if the game has ended - that is only one player remains
-
isVisible(int, int, int)
- returns true if the given row,col cell is visible to
the given player
-
killPlayer(int)
- kill the player given as an argument.
-
makeCell(int, int)
- makes a cell for the server board
-
makeRandomTerrain()
- produce terrain based on the geomorph tiles.
-
placePlayer(int)
- given a player number give the player a new city on the map.
-
removeVisibility(int, int, int)
- Removes visibility of adjacent cells for player assuming player
just lost occupancy of the cell at row, col.
-
update()
- update the board to reflect the passage of one unit of xbattle time.
-
updateCell(int, int)
- update a particular cell on the game board.
maxTroops
public final static int maxTroops
- this is the maximum number of actual troops permitted in
a cell at one time.
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
makeCell
public Cell makeCell(int r,
int c)
- makes a cell for the server board
- Overrides:
- makeCell in class Board
makeRandomTerrain
public void makeRandomTerrain()
- produce terrain based on the geomorph tiles.
placePlayer
public void placePlayer(int player)
- given a player number give the player a new city on the map.
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
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
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
asciiDump
public void asciiDump(int player)
- produce debugging output
update
public void update()
- update the board to reflect the passage of one unit of xbattle time.
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
isGameOver
public boolean isGameOver()
- return true if the game has ended - that is only one player remains
updateCell
public void updateCell(int row,
int col)
- update a particular cell on the game board.
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