Class NativeTradeSession


  • public class NativeTradeSession
    extends Session
    A type of session to handle trading with a native settlement.
    • 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 new NativeTradeSession.
        Parameters:
        nt - The NativeTrade
    • 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 proposed NativeTrade.
        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.
        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.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object