net.mlw.gfw.ext.basic.server
Class AbstractTurnBasedGame

java.lang.Object
  |
  +--net.mlw.gfw.ext.basic.server.AbstractTurnBasedGame
All Implemented Interfaces:
TurnBasedGame

public abstract class AbstractTurnBasedGame
extends java.lang.Object
implements TurnBasedGame

Version:
$Revision: 1.4 $ $Date: 2004/05/20 17:08:32 $
Author:
Matthew L. Wilson

Constructor Summary
AbstractTurnBasedGame(int numberOfSeats, int numberOfPlayersPerTeam)
           
 
Method Summary
 int getCurrentTurn()
          Gets the seat of the current turn.
 int getLeader()
          Gets the seat of the Player that started this round.
 int getNumberOfPlayersPerTeam()
          Gets the number of players per team.
 int getNumberOfSeats()
          Gets the number of players needed before a StartRoundEvent is sent.
 int getNumberSeated()
          Gets the number of players currently seated.
 net.mlw.gfw.ext.basic.server.Player getPlayerSeatedAt(int seat)
          Gets the player seated in the given seat.
 int getSeatOfPlayer(java.lang.String userName)
          Gets the seat index of the player.
 void setCurrentTurn(int turn)
          Sets the seat of the current turn.
 void setLeader(int leader)
           
 void setPlayerSeatedAt(net.mlw.gfw.ext.basic.server.Player player, int seat)
          Sets a player to a given seat.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTurnBasedGame

public AbstractTurnBasedGame(int numberOfSeats,
                             int numberOfPlayersPerTeam)
Parameters:
numberOfSeats -
Method Detail

getPlayerSeatedAt

public net.mlw.gfw.ext.basic.server.Player getPlayerSeatedAt(int seat)
Description copied from interface: TurnBasedGame
Gets the player seated in the given seat.

Specified by:
getPlayerSeatedAt in interface TurnBasedGame
Parameters:
seat - The seat the player is siting in.
Returns:
The player.
See Also:
TurnBasedGame.getPlayerSeatedAt(int)

setPlayerSeatedAt

public void setPlayerSeatedAt(net.mlw.gfw.ext.basic.server.Player player,
                              int seat)
Description copied from interface: TurnBasedGame
Sets a player to a given seat.

Specified by:
setPlayerSeatedAt in interface TurnBasedGame
Parameters:
player - The player.
seat - The seat the player is siting in.
See Also:
TurnBasedGame.setPlayerSeatedAt(net.mlw.gfw.ext.basic.server.Player, int)

getNumberOfSeats

public int getNumberOfSeats()
Description copied from interface: TurnBasedGame
Gets the number of players needed before a StartRoundEvent is sent.

Specified by:
getNumberOfSeats in interface TurnBasedGame
Returns:
The number of seats.
See Also:
TurnBasedGame.getNumberOfSeats()

getNumberSeated

public int getNumberSeated()
Description copied from interface: TurnBasedGame
Gets the number of players currently seated.

Specified by:
getNumberSeated in interface TurnBasedGame
Returns:
The number of Player(s) seated.
See Also:
TurnBasedGame.getNumberSeated()

getCurrentTurn

public int getCurrentTurn()
Description copied from interface: TurnBasedGame
Gets the seat of the current turn.

Specified by:
getCurrentTurn in interface TurnBasedGame
Returns:
The seat of the current turn.
See Also:
TurnBasedGame.getCurrentTurn()

setCurrentTurn

public void setCurrentTurn(int turn)
Description copied from interface: TurnBasedGame
Sets the seat of the current turn.

Specified by:
setCurrentTurn in interface TurnBasedGame
Parameters:
turn - The seat of the current turn.
See Also:
TurnBasedGame.setCurrentTurn(int)

getLeader

public int getLeader()
Description copied from interface: TurnBasedGame
Gets the seat of the Player that started this round.

Specified by:
getLeader in interface TurnBasedGame
Returns:
The seat of the Player that started this round.
See Also:
TurnBasedGame.getLeader()

getSeatOfPlayer

public int getSeatOfPlayer(java.lang.String userName)
Description copied from interface: TurnBasedGame
Gets the seat index of the player.

Specified by:
getSeatOfPlayer in interface TurnBasedGame
Parameters:
userName -
Returns:
See Also:
TurnBasedGame.getSeatOfPlayer(java.lang.String)

getNumberOfPlayersPerTeam

public int getNumberOfPlayersPerTeam()
Description copied from interface: TurnBasedGame
Gets the number of players per team.

Specified by:
getNumberOfPlayersPerTeam in interface TurnBasedGame
Returns:
The number of players per team.
See Also:
TurnBasedGame.getNumberOfPlayersPerTeam()

setLeader

public void setLeader(int leader)
Specified by:
setLeader in interface TurnBasedGame
See Also:
TurnBasedGame.setLeader(int)


Copyright © 2003-2004 mlavilson. All Rights Reserved.