Package net.sf.freecol.server.model
Class NativeTradeSession
- java.lang.Object
-
- net.sf.freecol.server.model.Session
-
- net.sf.freecol.server.model.NativeTradeSession
-
public class NativeTradeSession extends Session
A type of session to handle trading with a native settlement.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Loggerloggerprivate intmovesLeftThe moves the trading unit has left at start of session.private NativeTradentThe native trade information.
-
Constructor Summary
Constructors Modifier Constructor Description privateNativeTradeSession(NativeTrade nt)Creates a newNativeTradeSession.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancomplete(ChangeSet cs)All transaction types must implement a completion action.NativeTradegetNativeTrade()Get the native trade underway.static NativeTradeopenSession(NativeTrade nt)Helper function to update a tentative native trade and open a session for it.java.lang.StringtoString()-
Methods inherited from class net.sf.freecol.server.model.Session
clearAll, completeAll, findSession, getKey, lookup, lookup, lookup, makeSessionKey, makeSessionKey, register
-
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
movesLeft
private final int movesLeft
The moves the trading unit has left at start of session.
-
nt
private NativeTrade nt
The native trade information.
-
-
Constructor Detail
-
NativeTradeSession
private NativeTradeSession(NativeTrade nt)
Creates a newNativeTradeSession.- Parameters:
nt- TheNativeTrade
-
-
Method Detail
-
getNativeTrade
public NativeTrade getNativeTrade()
Get the native trade underway.- Returns:
- The
NativeTrade.
-
openSession
public static NativeTrade openSession(NativeTrade nt)
Helper function to update a tentative native trade and open a session for it.- Parameters:
nt- The proposedNativeTrade.- Returns:
- The updated
NativeTrade.
-
complete
public boolean complete(ChangeSet cs)
All transaction types must implement a completion action. This is called by the controller at the end of turn to complete any sessions that have not yet completed, or if the controller gets the required response to complete the session.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-