games.strategy.engine.xml
Class TestGameLoader

java.lang.Object
  extended by games.strategy.engine.xml.TestGameLoader
All Implemented Interfaces:
IGameLoader, java.io.Serializable

public class TestGameLoader
extends java.lang.Object
implements IGameLoader

Author:
Sean Bridges
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface games.strategy.engine.framework.IGameLoader
CLIENT_PLAYER_TYPE
 
Constructor Summary
TestGameLoader()
           
 
Method Summary
 java.util.Set<IGamePlayer> createPlayers(java.util.Map players)
          Create the players.
 java.lang.String[] getClientPlayerTypes()
          Return an array of player types that can play on the client.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestGameLoader

public TestGameLoader()
Method Detail

getServerPlayerTypes

public java.lang.String[] getServerPlayerTypes()
Return an array of player types that can play on the server. This array must not contain any entries that could play on the client.

Specified by:
getServerPlayerTypes in interface IGameLoader

getClientPlayerTypes

public java.lang.String[] getClientPlayerTypes()
Return an array of player types that can play on the client. This array must not contain any entries that could play on the server.


startGame

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

Specified by:
startGame in interface IGameLoader

getPBEMMessengers

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

Specified by:
getPBEMMessengers in interface IGameLoader

createPlayers

public 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 get*PlayerType() method.

Specified by:
createPlayers in interface IGameLoader
Returns:
a Set of GamePlayers

getDisplayType

public java.lang.Class<? extends IChannelSubscribor> getDisplayType()
Description copied from interface: IGameLoader
Get the type of the display

Specified by:
getDisplayType in interface IGameLoader
Returns:
an interface that extends IChannelSubscrobor

getRemotePlayerType

public java.lang.Class<? extends IRemote> getRemotePlayerType()
Description copied from interface: IGameLoader
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

Specified by:
getRemotePlayerType in interface IGameLoader
See Also:
IRemoteMessenger

shutDown

public void shutDown()
Specified by:
shutDown in interface IGameLoader

getUnitFactory

public IUnitFactory getUnitFactory()
Description copied from interface: IGameLoader
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.

Specified by:
getUnitFactory in interface IGameLoader