|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgames.strategy.engine.delegate.DefaultDelegateBridge
public class DefaultDelegateBridge
Default implementation of DelegateBridge
| Constructor Summary | |
|---|---|
DefaultDelegateBridge(GameData data,
IGame game,
IDelegateHistoryWriter historyWriter,
RandomStats randomStats,
DelegateExecutionManager delegateExecutionManager)
Creates new DefaultDelegateBridge |
|
| Method Summary | |
|---|---|
void |
addChange(Change aChange)
Add a change to game data. |
void |
enterDelegateExecution()
|
IChannelSubscribor |
getDisplayChannelBroadcaster()
Return an object that implements the IDisplay interface for the game. |
IDelegateHistoryWriter |
getHistoryWriter()
return the delegate history writer for this game. |
PlayerID |
getPlayerID()
|
int[] |
getRandom(int max,
int count,
java.lang.String annotation)
Delegates should not use random data that comes from any other source. |
int |
getRandom(int max,
java.lang.String annotation)
All delegates should use random data that comes from both players so that neither player cheats. |
IRemote |
getRemote()
equivalent to getRemote(getPlayerID()) |
IRemote |
getRemote(PlayerID id)
Get a remote reference to the given player. |
java.lang.String |
getStepName()
Returns the current step name |
java.util.Properties |
getStepProperties()
|
void |
leaveDelegateExecution()
|
void |
setRandomSource(IRandomSource randomSource)
|
void |
stopGameSequence()
After this step finishes executing, the next delegate will not be called. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultDelegateBridge(GameData data,
IGame game,
IDelegateHistoryWriter historyWriter,
RandomStats randomStats,
DelegateExecutionManager delegateExecutionManager)
| Method Detail |
|---|
public PlayerID getPlayerID()
getPlayerID in interface IDelegateBridgepublic void setRandomSource(IRandomSource randomSource)
public int getRandom(int max,
java.lang.String annotation)
getRandom in interface IDelegateBridge
public int[] getRandom(int max,
int count,
java.lang.String annotation)
getRandom in interface IDelegateBridgeannotation - -
a string used to describe the random event.public void addChange(Change aChange)
IDelegateBridge
addChange in interface IDelegateBridgepublic java.lang.String getStepName()
getStepName in interface IDelegateBridgepublic IDelegateHistoryWriter getHistoryWriter()
IDelegateBridgeThe delegate history writer allows writing to the game history.
getHistoryWriter in interface IDelegateBridgepublic IRemote getRemote()
IDelegateBridge
getRemote in interface IDelegateBridgepublic IRemote getRemote(PlayerID id)
IDelegateBridge
getRemote in interface IDelegateBridgeIRemoteMessengerpublic IChannelSubscribor getDisplayChannelBroadcaster()
IDelegateBridgeMethods called on this returned object will be invoked on all displays in the game, including those on remote machines
getDisplayChannelBroadcaster in interface IDelegateBridgepublic java.util.Properties getStepProperties()
getStepProperties in interface IDelegateBridgepublic void leaveDelegateExecution()
leaveDelegateExecution in interface IDelegateBridgepublic void enterDelegateExecution()
enterDelegateExecution in interface IDelegateBridgepublic void stopGameSequence()
IDelegateBridgeThis methd allows the delegate to signal that the game is over, but does not force the ui or the display to shutdown.
stopGameSequence in interface IDelegateBridge
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||