Package net.sf.freecol.server.model
Class MonarchSession
- java.lang.Object
-
- net.sf.freecol.server.model.Session
-
- net.sf.freecol.server.model.MonarchSession
-
public class MonarchSession extends Session
A type of session to handle monarch actions that require response.
-
-
Field Summary
Fields Modifier and Type Field Description private Monarch.MonarchAction
action
The action to be considered.private Goods
goods
The goods for the goods party.private static java.util.logging.Logger
logger
private java.util.List<AbstractUnit>
mercenaries
Mercenaries on offer.private int
price
Mercenary price.private ServerPlayer
serverPlayer
The player whose monarch is active.private int
tax
The amount of tax to raise.
-
Constructor Summary
Constructors Constructor Description MonarchSession(ServerPlayer serverPlayer, Monarch.MonarchAction action, int tax, Goods goods)
MonarchSession(ServerPlayer serverPlayer, Monarch.MonarchAction action, java.util.List<AbstractUnit> mercenaries, int price)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
complete(boolean result, ChangeSet cs)
Explicit completion of the session with a given result.boolean
complete(ChangeSet cs)
All transaction types must implement a completion action.private void
completeInternal(java.lang.Boolean result, ChangeSet cs)
Primitive level to finishing the session with the given result.Monarch.MonarchAction
getAction()
Goods
getGoods()
java.util.List<AbstractUnit>
getMercenaries()
int
getPrice()
int
getTax()
-
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
-
serverPlayer
private final ServerPlayer serverPlayer
The player whose monarch is active.
-
action
private final Monarch.MonarchAction action
The action to be considered.
-
tax
private final int tax
The amount of tax to raise.
-
goods
private Goods goods
The goods for the goods party.
-
mercenaries
private java.util.List<AbstractUnit> mercenaries
Mercenaries on offer.
-
price
private final int price
Mercenary price.
-
-
Constructor Detail
-
MonarchSession
public MonarchSession(ServerPlayer serverPlayer, Monarch.MonarchAction action, int tax, Goods goods)
-
MonarchSession
public MonarchSession(ServerPlayer serverPlayer, Monarch.MonarchAction action, java.util.List<AbstractUnit> mercenaries, int price)
-
-
Method Detail
-
completeInternal
private void completeInternal(java.lang.Boolean result, ChangeSet cs)
Primitive level to finishing the session with the given result.- Parameters:
result
- The result of the session, null means ignored.cs
- AChangeSet
to update.
-
complete
public boolean complete(boolean result, ChangeSet cs)
Explicit completion of the session with a given result. Called from the controller when the player returns a definite response.- Parameters:
result
- Whether to accept or reject the demand.cs
- AChangeSet
to update.- Returns:
- Whether the session was already complete.
-
complete
public boolean complete(ChangeSet cs)
Description copied from class:Session
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.
-
getAction
public Monarch.MonarchAction getAction()
-
getTax
public int getTax()
-
getGoods
public Goods getGoods()
-
getMercenaries
public java.util.List<AbstractUnit> getMercenaries()
-
getPrice
public int getPrice()
-
-