games.strategy.engine.delegate
Interface IDelegate

All Known Implementing Classes:
AbstractEndTurnDelegate, AbstractPlaceDelegate, BaseDelegate, BattleDelegate, BidPlaceDelegate, BidPurchaseDelegate, EditDelegate, EndRoundDelegate, EndTurnDelegate, EndTurnDelegate, EndTurnDelegate, GivePUsDelegate, InitDelegate, InitializationDelegate, InitializationDelegate, MoveDelegate, NoPUEndTurnDelegate, NoPUPurchaseDelegate, PlaceDelegate, PlaceDelegate, PlayDelegate, PurchaseDelegate, TechActivationDelegate, TechnologyDelegate, TestDelegate

public interface IDelegate

A section of code that implements game logic. The delegate should be deterministic. All random events should be obtained through calls to the delegateBridge. Delegates make changes to gameData by calling the addChange method in DelegateBridge. All delegates must have a zero argument constructor, due to reflection constraints. The delegate will be initialized with a call of initialize(..) before used. Delegates start executing with the start method, and stop with the end message. Delegates can be made accesseble to players through implementing an IRemote, and will be called through RemoteMessenger.

Version:
1.0
Author:
Sean Bridges

Method Summary
 void end()
          Called before the delegate will stop running.
 java.lang.String getDisplayName()
           
 java.lang.String getName()
           
 java.lang.Class<? extends IRemote> getRemoteType()
          Get the remote type of this delegate for use by a RemoteMessenger.
 void initialize(java.lang.String name, java.lang.String displayName)
           
 void loadState(java.io.Serializable state)
          Loads the delegates state
 java.io.Serializable saveState()
          Returns the state of the Delegate.
 void start(IDelegateBridge aBridge, GameData gameData)
          Called before the delegate will run.
 

Method Detail

initialize

void initialize(java.lang.String name,
                java.lang.String displayName)

start

void start(IDelegateBridge aBridge,
           GameData gameData)
Called before the delegate will run.


end

void end()
Called before the delegate will stop running.


getName

java.lang.String getName()

getDisplayName

java.lang.String getDisplayName()

saveState

java.io.Serializable saveState()
Returns the state of the Delegate.


loadState

void loadState(java.io.Serializable state)
Loads the delegates state


getRemoteType

java.lang.Class<? extends IRemote> getRemoteType()
Get the remote type of this delegate for use by a RemoteMessenger. Class must be an interface that extends IRemote If the return value is null, then it indicates that this delegate should not be used as in IRemote.