Class MarketWas


  • public class MarketWas
    extends java.lang.Object
    Helper container to remember the Market state prior to some change, and fire off any consequent property changes.
    • Constructor Summary

      Constructors 
      Constructor Description
      MarketWas​(Player player)
      Make a new MarketWas instance for the given player.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void fireChanges​(java.util.List<AbstractGoods> req)
      Fire any property changes resulting from actions in Market.
      void fireChanges​(GoodsType type, int amount)
      Fire any property changes resulting from actions in Market.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

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

        private final Market market
      • tax

        private final int tax
      • costToBuy

        private final java.util.Map<GoodsType,​java.lang.Integer> costToBuy
      • paidForSale

        private final java.util.Map<GoodsType,​java.lang.Integer> paidForSale
    • Constructor Detail

      • MarketWas

        public MarketWas​(Player player)
        Make a new MarketWas instance for the given player.
        Parameters:
        player - The Player to find a market for.
    • Method Detail

      • fireChanges

        public void fireChanges​(java.util.List<AbstractGoods> req)
        Fire any property changes resulting from actions in Market.
        Parameters:
        req - A list of AbstractGoods that changed hands.
      • fireChanges

        public void fireChanges​(GoodsType type,
                                int amount)
        Fire any property changes resulting from actions in Market.
        Parameters:
        type - A GoodsType that changed hands.
        amount - The amount of goods that changed hands.