Class MonarchSession


  • public class MonarchSession
    extends Session
    A type of session to handle monarch actions that require response.
    • Field Detail

      • logger

        private static final java.util.logging.Logger logger
      • serverPlayer

        private final ServerPlayer serverPlayer
        The player whose monarch is active.
      • 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.
    • 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 - A ChangeSet 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 - A ChangeSet 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.
        Overrides:
        complete in class Session
        Parameters:
        cs - A ChangeSet to update with changes that occur when completing this session.
        Returns:
        True if the session was already complete.
      • getTax

        public int getTax()
      • getGoods

        public Goods getGoods()
      • getMercenaries

        public java.util.List<AbstractUnit> getMercenaries()
      • getPrice

        public int getPrice()