コード例 #1
0
 private void DoSale(PetShopAnimalViewModel toSell)
 {
     Stock.Remove(toSell);
     Sales       = Sales + 1;
     Revenue     = Revenue + toSell.Price;
     BankBalance = BankBalance + toSell.Price;
 }
コード例 #2
0
        private void DoBuyAnimal(Animal animal, int cost)
        {
            var newStock = new PetShopAnimalViewModel();
            newStock.Animal = animal;
            newStock.Price = _pricingModel.CalculateInitialSalesPrice(cost);
            newStock.SellCommand = new MvxCommand(() => DoSale(newStock));

            BankBalance = BankBalance - cost;
            Stock.Add(newStock);
        }
コード例 #3
0
        private void DoBuyAnimal(Animal animal, int cost)
        {
            var newStock = new PetShopAnimalViewModel();

            newStock.Animal      = animal;
            newStock.Price       = _pricingModel.CalculateInitialSalesPrice(cost);
            newStock.SellCommand = new MvxCommand(() => DoSale(newStock));

            BankBalance = BankBalance - cost;
            Stock.Add(newStock);
        }
コード例 #4
0
 private void DoSale(PetShopAnimalViewModel toSell)
 {
     Stock.Remove(toSell);
     Sales = Sales + 1;
     Revenue = Revenue + toSell.Price;
     BankBalance = BankBalance + toSell.Price;
 }