示例#1
0
        public bool AddPurchaser(IPurchaser purchaser)
        {
            if (_activePurchasers.Contains(purchaser) == false)
            {
                _activePurchasers.Add(purchaser);
                return(true);
            }

            return(false);
        }
示例#2
0
        public bool BroadcastPurchaseCompletion(IPurchaser purchaser)
        {
            var isPurchaserActive = _activePurchasers.Remove(purchaser);

            if (isPurchaserActive)
            {
                _activePurchasers.ForEach(p => p.Receive(purchaser));
            }

            return(isPurchaserActive);
        }
示例#3
0
        public void Receive(IPurchaser purchaser)
        {
            var product = purchaser.GetProduct();

            _alertScreen.ShowMessage(product.Item, product.Location);
        }
示例#4
0
 public ShopCardModel(IPurchaser purchaser, ShopCardData shopLotData)
 {
     _shopCardData = shopLotData;
     _purchaser    = purchaser;
 }