games.strategy.engine.framework
Interface IGameLoader

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
KingsTable, TestGameLoader, TripleA

public interface IGameLoader
extends java.io.Serializable

A game loader is responsible for telling the framework what types of players are available, for creating players, and starting the game. The name is somewhat misleading since it doesnt actually load the game data, merely performs the game specific steps for starting the game and meta data needed by the engine.

Author:
Sean Bridges

Field Summary
static java.lang.String CLIENT_PLAYER_TYPE
           
 
Method Summary
 java.util.Set<IGamePlayer> createPlayers(java.util.Map players)
          Create the players.
 java.lang.Class<? extends IChannelSubscribor> getDisplayType()
          Get the type of the display
 IPBEMMessenger[] getPBEMMessengers()
          Get PBEM messengers for Turn Summary notification
 java.lang.Class<? extends IRemote> getRemotePlayerType()
          Get the type of the GamePlayer.
 java.lang.String[] getServerPlayerTypes()
          Return an array of player types that can play on the server.
 IUnitFactory getUnitFactory()
          A game may use a subclass of Unit to allow associating data with a particular unit.
 void shutDown()
           
 void startGame(IGame game, java.util.Set<IGamePlayer> players)
          The game is about to start.
 

Field Detail

CLIENT_PLAYER_TYPE

static final java.lang.String CLIENT_PLAYER_TYPE
See Also:
Constant Field Values
Method Detail

getServerPlayerTypes

java.lang.String[] getServerPlayerTypes()
Return an array of player types that can play on the server.


createPlayers

java.util.Set<IGamePlayer> createPlayers(java.util.Map players)
Create the players. Given a map of playerName -> type, where type is one of the Strings returned by a getServerPlayerTypes() or IGameLoader.CLIENT_PLAYER_TYPE.

Returns:
a Set of GamePlayers

startGame

void startGame(IGame game,
               java.util.Set<IGamePlayer> players)
               throws java.lang.Exception
The game is about to start.

Throws:
java.lang.Exception

getPBEMMessengers

IPBEMMessenger[] getPBEMMessengers()
Get PBEM messengers for Turn Summary notification


getDisplayType

java.lang.Class<? extends IChannelSubscribor> getDisplayType()
Get the type of the display

Returns:
an interface that extends IChannelSubscrobor

getRemotePlayerType

java.lang.Class<? extends IRemote> getRemotePlayerType()
Get the type of the GamePlayer.

The type must extend IRemote, and is to be used by an IRemoteManager to allow a player to be contacted remotately

See Also:
IRemoteMessenger

shutDown

void shutDown()

getUnitFactory

IUnitFactory getUnitFactory()
A game may use a subclass of Unit to allow associating data with a particular unit. The game does this by specifying a IUnitFactory that should be used to create units.

Games that do not want to subclasses of units should simply return a DefaultUnitFactory.