net.mlw.gfw.ext.basic.server
Interface TurnBasedGame

All Known Implementing Classes:
AbstractTurnBasedGame

public interface TurnBasedGame

A Game contains the logic and rules of a game. IT should not contain any Event(s) of EventHandlers. In a MVC, this would be the model.

Version:
$Revision: 1.4 $ $Date: 2004/06/25 20:13:26 $
Author:
Matthew L. Wilson

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.
 

Method Detail

getNumberOfSeats

public int getNumberOfSeats()
Gets the number of players needed before a StartRoundEvent is sent.

Returns:
The number of seats.

getNumberSeated

public int getNumberSeated()
Gets the number of players currently seated.

Returns:
The number of Player(s) seated.

getPlayerSeatedAt

public net.mlw.gfw.ext.basic.server.Player getPlayerSeatedAt(int seat)
Gets the player seated in the given seat.

Parameters:
seat - The seat the player is siting in.
Returns:
The player.
Throws:
java.lang.IndexOutOfBoundsException - if an invalid seat is passed.

setPlayerSeatedAt

public void setPlayerSeatedAt(net.mlw.gfw.ext.basic.server.Player player,
                              int seat)
Sets a player to a given seat.

Parameters:
player - The player.
seat - The seat the player is siting in.
Throws:
java.lang.IndexOutOfBoundsException - if an invalid seat is passed.
SeatTakenException - is the seat is already taken.

getCurrentTurn

public int getCurrentTurn()
Gets the seat of the current turn.

Returns:
The seat of the current turn.

setCurrentTurn

public void setCurrentTurn(int turn)
Sets the seat of the current turn.

Parameters:
turn - The seat of the current turn.

getLeader

public int getLeader()
Gets the seat of the Player that started this round.

Returns:
The seat of the Player that started this round.

setLeader

public void setLeader(int leader)

getSeatOfPlayer

public int getSeatOfPlayer(java.lang.String userName)
Gets the seat index of the player.

Parameters:
userName -
Returns:

getNumberOfPlayersPerTeam

public int getNumberOfPlayersPerTeam()
Gets the number of players per team.

Returns:
The number of players per team.


Copyright © 2003-2004 mlavilson. All Rights Reserved.