games.strategy.triplea.delegate
Class TechnologyDelegate

java.lang.Object
  extended by games.strategy.triplea.delegate.TechnologyDelegate
All Implemented Interfaces:
IDelegate, IRemote, ITechDelegate

public class TechnologyDelegate
extends java.lang.Object
implements IDelegate, ITechDelegate

Logic for dealing with player tech rolls. This class requires the TechActivationDelegate which actually activates the tech.

Version:
1.0
Author:
Sean Bridges

Constructor Summary
TechnologyDelegate()
          Creates new TechnolgoyDelegate
 
Method Summary
 void end()
          Called before the delegate will stop running.
 java.util.Map<PlayerID,java.util.Collection> getAdvances()
           
 java.lang.String getDisplayName()
           
 java.lang.String getName()
           
 java.lang.Class<ITechDelegate> 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
 TechResults rollTech(int techRolls, TechAdvance techToRollFor, int newTokens)
           
 java.io.Serializable saveState()
          Returns the state of the Delegate.
 void start(IDelegateBridge aBridge, GameData gameData)
          Called before the delegate will run.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TechnologyDelegate

public TechnologyDelegate()
Creates new TechnolgoyDelegate

Method Detail

initialize

public void initialize(java.lang.String name,
                       java.lang.String displayName)
Specified by:
initialize in interface IDelegate

start

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

Specified by:
start in interface IDelegate

getAdvances

public java.util.Map<PlayerID,java.util.Collection> getAdvances()

rollTech

public TechResults rollTech(int techRolls,
                            TechAdvance techToRollFor,
                            int newTokens)
Specified by:
rollTech in interface ITechDelegate
Parameters:
techRolls - - the number of tech rolls
Returns:
TechResults. If the tech could not be rolled, then a message saying why.

getName

public java.lang.String getName()
Specified by:
getName in interface IDelegate

getDisplayName

public java.lang.String getDisplayName()
Specified by:
getDisplayName in interface IDelegate

end

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

Specified by:
end in interface IDelegate

saveState

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

Specified by:
saveState in interface IDelegate

loadState

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

Specified by:
loadState in interface IDelegate

getRemoteType

public java.lang.Class<ITechDelegate> getRemoteType()
Description copied from interface: IDelegate
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.

Specified by:
getRemoteType in interface IDelegate