games.strategy.engine.framework
Class ClientGame

java.lang.Object
  extended by games.strategy.engine.framework.ClientGame
All Implemented Interfaces:
IGame

public class ClientGame
extends java.lang.Object
implements IGame

Author:
Sean Bridges

Field Summary
 
Fields inherited from interface games.strategy.engine.framework.IGame
GAME_MODIFICATION_CHANNEL
 
Constructor Summary
ClientGame(GameData data, java.util.Set<IGamePlayer> gamePlayers, PlayerManager playerManager, Messengers messengers)
           
 
Method Summary
 void addChange(Change aChange)
          Should not be called outside of engine code.
 void addDisplay(IDisplay display)
          add a display that will recieve broadcasts from the IDelegateBridge.getDisplayBroadvaster
 void addGameStepListener(GameStepListener listener)
           
 boolean canSave()
          Clients cant save because they do not have the delegate data.
 IChannelMessenger getChannelMessenger()
           
 GameData getData()
           
 IMessenger getMessenger()
           
 PlayerManager getPlayerManager()
           
 IRandomSource getRandomSource()
           
 IRemoteMessenger getRemoteMessenger()
           
static RemoteName getRemoteStepAdvancerName(INode node)
           
 Vault getVault()
           
 boolean isGameOver()
          Is the game over.
 void removeDisplay(IDisplay display)
          remove a display
 void removeGameStepListener(GameStepListener listener)
           
 void saveGame(java.io.File f)
          Save the game to the given directory.
 void shutDown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientGame

public ClientGame(GameData data,
                  java.util.Set<IGamePlayer> gamePlayers,
                  PlayerManager playerManager,
                  Messengers messengers)
Method Detail

getRemoteStepAdvancerName

public static final RemoteName getRemoteStepAdvancerName(INode node)

shutDown

public void shutDown()

getData

public GameData getData()
Specified by:
getData in interface IGame

getMessenger

public IMessenger getMessenger()
Specified by:
getMessenger in interface IGame

getChannelMessenger

public IChannelMessenger getChannelMessenger()
Specified by:
getChannelMessenger in interface IGame

getRemoteMessenger

public IRemoteMessenger getRemoteMessenger()
Specified by:
getRemoteMessenger in interface IGame

addGameStepListener

public void addGameStepListener(GameStepListener listener)
Specified by:
addGameStepListener in interface IGame

removeGameStepListener

public void removeGameStepListener(GameStepListener listener)
Specified by:
removeGameStepListener in interface IGame

addChange

public void addChange(Change aChange)
Description copied from interface: IGame
Should not be called outside of engine code.

Specified by:
addChange in interface IGame

canSave

public boolean canSave()
Clients cant save because they do not have the delegate data. It would be easy to get the server to save the game, and send the data to the client, I just havent bothered.

Specified by:
canSave in interface IGame

getRandomSource

public IRandomSource getRandomSource()
Specified by:
getRandomSource in interface IGame

getVault

public Vault getVault()
Specified by:
getVault in interface IGame

addDisplay

public void addDisplay(IDisplay display)
Description copied from interface: IGame
add a display that will recieve broadcasts from the IDelegateBridge.getDisplayBroadvaster

Specified by:
addDisplay in interface IGame

removeDisplay

public void removeDisplay(IDisplay display)
Description copied from interface: IGame
remove a display

Specified by:
removeDisplay in interface IGame

isGameOver

public boolean isGameOver()
Description copied from interface: IGame
Is the game over. Game over does not relate to the state of the game (eg check-mate in chess) but to the game being shut down and all players have left.

Specified by:
isGameOver in interface IGame

getPlayerManager

public PlayerManager getPlayerManager()
Specified by:
getPlayerManager in interface IGame
Returns:
a listing of who is playing who.

saveGame

public void saveGame(java.io.File f)
Description copied from interface: IGame
Save the game to the given directory. The file should exist and be writeable.

Specified by:
saveGame in interface IGame