|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgames.strategy.triplea.delegate.MoveDelegate
public class MoveDelegate
Responsible for moving units on the board.
Responible for checking the validity of a move, and for moving the units.
| Constructor Summary | |
|---|---|
MoveDelegate()
Creates new MoveDelegate |
|
| Method Summary | |
|---|---|
void |
end()
Called before the delegate will stop running. |
Change |
ensureCanMoveOneSpaceChange(Unit unit)
|
static BattleTracker |
getBattleTracker(GameData data)
|
java.lang.String |
getDisplayName()
|
static java.util.Collection<Territory> |
getEmptyNeutral(Route route)
|
java.util.List<UndoableMove> |
getMovesMade()
Get the moves already made |
java.lang.String |
getName()
|
java.lang.Class<IMoveDelegate> |
getRemoteType()
Get the remote type of this delegate for use by a RemoteMessenger. |
static Route |
getRouteUsedToMoveInto(java.util.List<UndoableMove> undoableMoves,
Unit unit,
Territory end)
Find the route that a unit used to move into the given territory. |
Route |
getRouteUsedToMoveInto(Unit unit,
Territory end)
Find the route that a unit used to move into the given territory. |
java.util.Collection<Territory> |
getTerritoriesWhereAirCantLand()
Get what air units must move before the end of the players turn |
java.util.Collection<Territory> |
getTerritoriesWhereUnitsCantFight()
Get what units must have combat ability |
TransportTracker |
getTransportTracker()
|
void |
initialize(java.lang.String name,
java.lang.String displayName)
|
static boolean |
isNonCombat(IDelegateBridge aBridge)
|
java.lang.String |
loadBombers(java.util.Collection<Unit> units,
Route route,
java.util.Collection<Unit> transportsThatCanBeLoaded)
|
void |
loadState(java.io.Serializable aState)
Loads the delegates state |
static java.util.Map<Unit,Unit> |
mapBombers(Route route,
java.util.Collection<Unit> units,
java.util.Collection<Unit> bombersToLoad)
returns a map of unit -> bomber. returns null if no mapping can be done either because there is not sufficient transport capacity or because a unit is not with its transport This method is static so it can be called from the client side. |
static java.util.Map<Unit,Unit> |
mapTransports(Route route,
java.util.Collection<Unit> units,
java.util.Collection<Unit> transportsToLoad)
returns a map of unit -> transport. returns null if no mapping can be done either because there is not sufficient transport capacity or because a unit is not with its transport This method is static so it can be called from the client side. |
static java.util.Map<Unit,Unit> |
mapTransports(Route route,
java.util.Collection<Unit> units,
java.util.Collection<Unit> transportsToLoad,
boolean isload,
PlayerID player)
returns a map of unit -> transport. returns null if no mapping can be done either because there is not sufficient transport capacity or because a unit is not with its transport This method is static so it can be called from the client side. |
Change |
markNoMovementChange(java.util.Collection<Unit> units)
Mark units as having no movement. |
java.lang.String |
move(java.util.Collection<Unit> units,
Route route)
equivalent to move(units, route, Collections.EMPTY_LIST) |
java.lang.String |
move(java.util.Collection<Unit> units,
Route route,
java.util.Collection<Unit> transportsThatCanBeLoaded)
|
int |
PUsAlreadyLost(Territory t)
Return the number of PUs that have been lost by bombing, rockets, etc. |
void |
PUsLost(Territory t,
int amt)
Add more PUs lost to a territory due to bombing, rockets, etc. |
java.io.Serializable |
saveState()
Returns the state of the Delegate. |
void |
start(IDelegateBridge aBridge,
GameData gameData)
Called before the delegate will run. |
java.lang.String |
undoMove(int moveIndex)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MoveDelegate()
| Method Detail |
|---|
public void initialize(java.lang.String name,
java.lang.String displayName)
initialize in interface IDelegatepublic static boolean isNonCombat(IDelegateBridge aBridge)
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 java.util.List<UndoableMove> getMovesMade()
IMoveDelegate
getMovesMade in interface IMoveDelegatepublic java.lang.String undoMove(int moveIndex)
undoMove in interface IMoveDelegatemoveIndex - - an index in the list getMovesMade
public java.lang.String move(java.util.Collection<Unit> units,
Route route)
IMoveDelegate
move in interface IMoveDelegateunits - - the units to moveroute - - the route to move along
public java.lang.String move(java.util.Collection<Unit> units,
Route route,
java.util.Collection<Unit> transportsThatCanBeLoaded)
move in interface IMoveDelegateunits - - the units to moveroute - - the route to move alongtransportsThatCanBeLoaded - - transports that can be loaded while moving, must be non null
public java.lang.String loadBombers(java.util.Collection<Unit> units,
Route route,
java.util.Collection<Unit> transportsThatCanBeLoaded)
loadBombers in interface IMoveDelegateunits - - the units to moveroute - - the route to move alongtransportsThatCanBeLoaded - - bombers that can be loaded while moving, must be non null
public static BattleTracker getBattleTracker(GameData data)
public static java.util.Collection<Territory> getEmptyNeutral(Route route)
public Change markNoMovementChange(java.util.Collection<Unit> units)
public Change ensureCanMoveOneSpaceChange(Unit unit)
public void end()
end in interface IDelegate
public static java.util.Map<Unit,Unit> mapTransports(Route route,
java.util.Collection<Unit> units,
java.util.Collection<Unit> transportsToLoad)
public static java.util.Map<Unit,Unit> mapTransports(Route route,
java.util.Collection<Unit> units,
java.util.Collection<Unit> transportsToLoad,
boolean isload,
PlayerID player)
public static java.util.Map<Unit,Unit> mapBombers(Route route,
java.util.Collection<Unit> units,
java.util.Collection<Unit> bombersToLoad)
public java.util.Collection<Territory> getTerritoriesWhereAirCantLand()
IMoveDelegate
getTerritoriesWhereAirCantLand in interface IMoveDelegatepublic java.util.Collection<Territory> getTerritoriesWhereUnitsCantFight()
IMoveDelegate
getTerritoriesWhereUnitsCantFight in interface IMoveDelegate
public Route getRouteUsedToMoveInto(Unit unit,
Territory end)
public static Route getRouteUsedToMoveInto(java.util.List<UndoableMove> undoableMoves,
Unit unit,
Territory end)
public int PUsAlreadyLost(Territory t)
public void PUsLost(Territory t,
int amt)
public TransportTracker getTransportTracker()
public java.io.Serializable saveState()
IDelegate
saveState in interface IDelegatepublic java.lang.Class<IMoveDelegate> getRemoteType()
IDelegate
getRemoteType in interface IDelegatepublic void loadState(java.io.Serializable aState)
loadState in interface IDelegate
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||