Class TraderState

  • All Implemented Interfaces:
    IPerson, ITavernPerson, ITradePerson, ITrader

    public class TraderState
    extends BaseTavernPerson
    implements ITrader
    Implementation of a trader. Every city can have a trader and is referenced through it's TavernEngine.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2013 Created on Jan 20, 2013
    • Field Detail

      • tradePerson

        @Autowired
        @Qualifier("baseTradePerson")
        private BaseTradePerson tradePerson
    • Constructor Detail

      • TraderState

        public TraderState()
    • Method Detail

      • getWare

        public IWare getWare()
        Description copied from interface: ITradePerson
        The ware the broker is to be delivered.
        Specified by:
        getWare in interface ITradePerson
        Returns:
        ware the trader whiches to aquire.
      • setWare

        public void setWare​(IWare ware)
        Description copied from interface: ITradePerson
        Set the ware for the trade.
        Specified by:
        setWare in interface ITradePerson
        Parameters:
        ware - of the trade
      • getAmount

        public int getAmount()
        Description copied from interface: ITradePerson
        Amount of the ware that is to be delivered. The amount is in the ware specific quantity.
        Specified by:
        getAmount in interface ITradePerson
        Returns:
        amount of the ware
      • getAvgPricePerItem

        public int getAvgPricePerItem()
        Description copied from interface: ITradePerson
        Get the price of a single item
        Specified by:
        getAvgPricePerItem in interface ITradePerson
        Returns:
        average price per item.
      • setAmount

        public void setAmount​(int amount)
        Description copied from interface: ITradePerson
        Set the amount of the trade
        Specified by:
        setAmount in interface ITradePerson
        Parameters:
        amount - of the ware to be traded
      • setAvgPricePerItem

        public void setAvgPricePerItem​(int avgPricePerItem)
        Description copied from interface: ITradePerson
        Set the price per item
        Specified by:
        setAvgPricePerItem in interface ITradePerson
        Parameters:
        avgPricePerItem - average price per item of the ware.