public class TradeSession extends TransactionSession
Modifier and Type | Field and Description |
---|---|
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.
|
allSessions
Constructor and Description |
---|
TradeSession(Unit unit,
Settlement settlement)
Creates a new
TradeSession . |
Modifier and Type | Method and Description |
---|---|
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() |
clearAll, completeAll, lookup, lookup, makeSessionKey, makeSessionKey
private static final java.util.logging.Logger logger
private final int movesLeft
private boolean actionTaken
private boolean canBuy
private boolean canSell
private boolean canGift
public TradeSession(Unit unit, Settlement settlement)
TradeSession
.unit
- The Unit
that is trading.settlement
- The Settlement
to trade with.public void complete(ChangeSet cs)
TransactionSession
complete
in class TransactionSession
cs
- A ChangeSet
to update with changes that
occur when completing this session.public int getMovesLeft()
public boolean getActionTaken()
public boolean getBuy()
public boolean getSell()
public boolean getGift()
public void setBuy()
public void setSell()
public void setGift()