|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgames.strategy.triplea.delegate.AbstractPlaceDelegate
public abstract class AbstractPlaceDelegate
Logic for placing units.
| Field Summary | |
|---|---|
protected GameData |
m_data
|
protected java.util.Map<Territory,java.util.Collection<Unit>> |
m_produced
|
| Constructor Summary | |
|---|---|
AbstractPlaceDelegate()
|
|
| Method Summary | |
|---|---|
protected java.lang.String |
canProduce(Territory to,
java.util.Collection<Unit> units,
PlayerID player)
Test whether or not the territory has the factory resources to support the placement. |
java.lang.String |
canUnitsBePlaced(Territory to,
java.util.Collection<Unit> units,
PlayerID player)
|
protected java.lang.String |
checkProduction(Territory to,
java.util.Collection<Unit> units,
PlayerID player)
Test whether or not the territory has the factory resources to support the placement. |
void |
end()
Called before the delegate will stop running. |
protected GameData |
getData()
|
java.lang.String |
getDisplayName()
|
protected int |
getMaxUnitsToBePlaced(java.util.Collection<Unit> units,
Territory to,
PlayerID player)
|
java.lang.String |
getName()
|
PlaceableUnits |
getPlaceableUnits(java.util.Collection<Unit> units,
Territory to)
Query what units can be produced in a given territory. |
int |
getPlacementsMade()
|
protected int |
getProduction(Territory territory)
|
java.lang.Class<? extends IRemote> |
getRemoteType()
Get the remote type of this delegate for use by a RemoteMessenger. |
java.util.Collection<Territory> |
getTerritoriesWhereAirCantLand()
Get what air units must move before the end of the players turn |
protected java.util.Collection<Unit> |
getUnitsToBePlacedLand(Territory to,
java.util.Collection<Unit> units,
PlayerID player)
|
protected java.util.Collection<Unit> |
getUnitsToBePlacedSea(Territory to,
java.util.Collection<Unit> units,
PlayerID player)
|
void |
initialize(java.lang.String name)
|
void |
initialize(java.lang.String name,
java.lang.String displayName)
|
protected boolean |
isUnitPlacementInEnemySeas()
|
protected java.lang.String |
isValidPlacement(java.util.Collection<Unit> units,
Territory at,
PlayerID player)
Subclasses can over ride this to change the way placements are made. |
protected boolean |
isWW2V2()
|
void |
loadState(java.io.Serializable aState)
Loads the delegates state |
java.lang.String |
placeUnits(java.util.Collection<Unit> units,
Territory at)
Place units. |
java.io.Serializable |
saveState()
Returns the state of the Delegate. |
void |
start(IDelegateBridge aBridge,
GameData gameData)
Called before the delegate will run. |
void |
undoLastPlacement()
Undoes the last placement. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Map<Territory,java.util.Collection<Unit>> m_produced
protected GameData m_data
| Constructor Detail |
|---|
public AbstractPlaceDelegate()
| Method Detail |
|---|
public void initialize(java.lang.String name)
public void initialize(java.lang.String name,
java.lang.String displayName)
initialize in interface IDelegate
public void start(IDelegateBridge aBridge,
GameData gameData)
start in interface IDelegatepublic java.lang.String getName()
getName in interface IDelegatepublic java.lang.String getDisplayName()
getDisplayName in interface IDelegatepublic int getPlacementsMade()
getPlacementsMade in interface IAbstractPlaceDelegatepublic void undoLastPlacement()
IAbstractPlaceDelegate
undoLastPlacement in interface IAbstractPlaceDelegate
public java.lang.String placeUnits(java.util.Collection<Unit> units,
Territory at)
IAbstractPlaceDelegate
placeUnits in interface IAbstractPlaceDelegate
public PlaceableUnits getPlaceableUnits(java.util.Collection<Unit> units,
Territory to)
IAbstractPlaceDelegate
getPlaceableUnits in interface IAbstractPlaceDelegate
protected java.lang.String isValidPlacement(java.util.Collection<Unit> units,
Territory at,
PlayerID player)
public java.lang.String canUnitsBePlaced(Territory to,
java.util.Collection<Unit> units,
PlayerID player)
protected java.util.Collection<Unit> getUnitsToBePlacedSea(Territory to,
java.util.Collection<Unit> units,
PlayerID player)
protected java.util.Collection<Unit> getUnitsToBePlacedLand(Territory to,
java.util.Collection<Unit> units,
PlayerID player)
protected int getMaxUnitsToBePlaced(java.util.Collection<Unit> units,
Territory to,
PlayerID player)
protected int getProduction(Territory territory)
protected java.lang.String canProduce(Territory to,
java.util.Collection<Unit> units,
PlayerID player)
protected java.lang.String checkProduction(Territory to,
java.util.Collection<Unit> units,
PlayerID player)
protected boolean isWW2V2()
protected boolean isUnitPlacementInEnemySeas()
public void end()
end in interface IDelegatepublic java.util.Collection<Territory> getTerritoriesWhereAirCantLand()
getTerritoriesWhereAirCantLand in interface IAbstractPlaceDelegatepublic final java.io.Serializable saveState()
saveState in interface IDelegatepublic java.lang.Class<? extends IRemote> getRemoteType()
IDelegate
getRemoteType in interface IDelegatepublic final void loadState(java.io.Serializable aState)
loadState in interface IDelegateprotected GameData getData()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||