net.sf.freecol.server.model
Class TradeSession

java.lang.Object
  extended by net.sf.freecol.server.model.TransactionSession
      extended by net.sf.freecol.server.model.TradeSession

public class TradeSession
extends TransactionSession

A type of session to handle trading.


Field Summary
private  boolean actionTaken
          Whether any action has been taken in this session.
private  boolean canBuy
          Whether buying is still valid in this session.
private  boolean canGift
          Whether giving a gift is still valid in this session.
private  boolean canSell
          Whether selling is still valid in this session.
private static java.util.logging.Logger logger
           
private  int movesLeft
          The moves the trading unit has left at start of session.
 
Fields inherited from class net.sf.freecol.server.model.TransactionSession
allSessions
 
Constructor Summary
TradeSession(Unit unit, Settlement settlement)
           
 
Method Summary
 void complete(ChangeSet cs)
          All transaction types must implement a completion action.
 boolean getActionTaken()
           
 boolean getBuy()
           
 boolean getGift()
           
 int getMovesLeft()
           
 boolean getSell()
           
 void setBuy()
           
 void setGift()
           
 void setSell()
           
 
Methods inherited from class net.sf.freecol.server.model.TransactionSession
clearAll, completeAll, lookup, lookup, makeSessionKey, makeSessionKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final java.util.logging.Logger logger

movesLeft

private int movesLeft
The moves the trading unit has left at start of session.


actionTaken

private boolean actionTaken
Whether any action has been taken in this session.


canBuy

private boolean canBuy
Whether buying is still valid in this session.


canSell

private boolean canSell
Whether selling is still valid in this session.


canGift

private boolean canGift
Whether giving a gift is still valid in this session.

Constructor Detail

TradeSession

public TradeSession(Unit unit,
                    Settlement settlement)
Method Detail

complete

public void complete(ChangeSet cs)
Description copied from class: TransactionSession
All transaction types must implement a completion action. The last thing they should do is call this to remove reference to this transaction.

Overrides:
complete in class TransactionSession
Parameters:
cs - A ChangeSet to update with changes that occur when completing this session.

getMovesLeft

public int getMovesLeft()

getActionTaken

public boolean getActionTaken()

getBuy

public boolean getBuy()

getSell

public boolean getSell()

getGift

public boolean getGift()

setBuy

public void setBuy()

setSell

public void setSell()

setGift

public void setGift()