games.strategy.triplea.delegate
Class EditDelegate

java.lang.Object
  extended by games.strategy.triplea.delegate.EditDelegate
All Implemented Interfaces:
IDelegate, IPersistentDelegate, IRemote, IEditDelegate

public class EditDelegate
extends java.lang.Object
implements IDelegate, IEditDelegate

Edit game state

Author:
Tony Clayton

Constructor Summary
EditDelegate()
           
 
Method Summary
 java.lang.String addComment(java.lang.String message)
           
 java.lang.String addUnits(Territory territory, java.util.Collection<Unit> units)
           
 java.lang.String changePUs(PlayerID player, int newTotal)
           
 java.lang.String changeTechTokens(PlayerID player, int newTotal)
           
 java.lang.String changeTerritoryOwner(Territory territory, PlayerID player)
           
 void end()
          This will never be called since this is an IPersistentDelegate
 java.lang.String getDisplayName()
           
 boolean getEditMode()
           
static boolean getEditMode(GameData data)
           
 java.lang.String getName()
           
protected  int getProduction(Territory territory)
           
 java.lang.Class<? extends IRemote> getRemoteType()
          Get the remote type of this delegate for use by a RemoteMessenger.
 void initialize(java.lang.String name)
           
 void initialize(java.lang.String name, java.lang.String displayName)
           
 void loadState(java.io.Serializable state)
          Loads the delegates state
 java.lang.String removeUnits(Territory territory, java.util.Collection<Unit> units)
           
 java.io.Serializable saveState()
          Returns the state of the Delegate.
 java.lang.String setEditMode(boolean editMode)
           
 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

EditDelegate

public EditDelegate()
Method Detail

getEditMode

public static boolean getEditMode(GameData data)

initialize

public void initialize(java.lang.String name)

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

end

public void end()
This will never be called since this is an IPersistentDelegate

Specified by:
end in interface IDelegate

getName

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

getDisplayName

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

setEditMode

public java.lang.String setEditMode(boolean editMode)
Specified by:
setEditMode in interface IEditDelegate

getEditMode

public boolean getEditMode()
Specified by:
getEditMode in interface IEditDelegate

removeUnits

public java.lang.String removeUnits(Territory territory,
                                    java.util.Collection<Unit> units)
Specified by:
removeUnits in interface IEditDelegate

addUnits

public java.lang.String addUnits(Territory territory,
                                 java.util.Collection<Unit> units)
Specified by:
addUnits in interface IEditDelegate

getProduction

protected int getProduction(Territory territory)
Returns:
gets the production of the territory, ignores wether the territory was an original factory

changeTerritoryOwner

public java.lang.String changeTerritoryOwner(Territory territory,
                                             PlayerID player)
Specified by:
changeTerritoryOwner in interface IEditDelegate

changePUs

public java.lang.String changePUs(PlayerID player,
                                  int newTotal)
Specified by:
changePUs in interface IEditDelegate

changeTechTokens

public java.lang.String changeTechTokens(PlayerID player,
                                         int newTotal)
Specified by:
changeTechTokens in interface IEditDelegate

addComment

public java.lang.String addComment(java.lang.String message)
Specified by:
addComment in interface IEditDelegate

getRemoteType

public java.lang.Class<? extends IRemote> 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

loadState

public void loadState(java.io.Serializable state)
Description copied from interface: IDelegate
Loads the delegates state

Specified by:
loadState in interface IDelegate

saveState

public java.io.Serializable saveState()
Description copied from interface: IDelegate
Returns the state of the Delegate.

Specified by:
saveState in interface IDelegate