Esempio n. 1
0
 public void InitDialog(Good g, Good.BUY_HOW how, int sel, string extraConfirm)
 {
     InitDialog(g, how, sel);
     autoChargeConfirm = extraConfirm;
     cantBuy           = false;
     if (BuildOption.Instance.IsNetmarble || BuildOption.Instance.IsDeveloper)
     {
         int price = good.GetPrice(selected, buyHow);
         if (buyHow == Good.BUY_HOW.BRICK_POINT)
         {
             if (MyInfoManager.Instance.BrickPoint < price)
             {
                 cantBuy = true;
             }
         }
         else if (buyHow == Good.BUY_HOW.GENERAL_POINT)
         {
             if (MyInfoManager.Instance.Point < price)
             {
                 cantBuy = true;
             }
         }
         else if (buyHow == Good.BUY_HOW.CASH_POINT && MyInfoManager.Instance.Cash < price)
         {
             cantBuy = true;
         }
     }
 }
Esempio n. 2
0
 public void InitDialog(long r, Good g, Good.BUY_HOW how, int sel)
 {
     wasEquip          = false;
     rebuy             = r;
     good              = g;
     tItem             = good.tItem;
     buyHow            = how;
     selected          = sel;
     autoChargeConfirm = string.Empty;
     cantBuy           = false;
     if (BuildOption.Instance.IsNetmarble || BuildOption.Instance.IsDeveloper)
     {
         int price = good.GetPrice(selected, buyHow);
         if (buyHow == Good.BUY_HOW.BRICK_POINT)
         {
             if (MyInfoManager.Instance.BrickPoint < price)
             {
                 cantBuy = true;
             }
         }
         else if (buyHow == Good.BUY_HOW.GENERAL_POINT)
         {
             if (MyInfoManager.Instance.Point < price)
             {
                 cantBuy = true;
             }
         }
         else if (buyHow == Good.BUY_HOW.CASH_POINT && MyInfoManager.Instance.Cash < price)
         {
             cantBuy = true;
         }
     }
 }
 public void should_calculate_tax_for_imported_perfume()
 {
     var good = new Good(47.50, GoodType.Other, true);
     Assert.Equal(54.65, good.GetPrice(), _comparer);
 }
 public void should_calculate_tax_for_imported_cholocate()
 {
     var good = new Good(10.00, GoodType.Food, true);
     Assert.Equal(10.50, good.GetPrice(), _comparer);
 }
 public void should_calculate_tax_for_a_cholocate()
 {
     var cholocate = new Good(0.85, GoodType.Food);
     Assert.Equal(0.85,cholocate.GetPrice(),_comparer);
 }
 public void should_calculate_tax_for_a_CD()
 {
     var cd = new Good(14.99, GoodType.Other);
     Assert.Equal(16.49, cd.GetPrice(), _comparer);
 }
 public void should_calculate_tax_for_a_book()
 {
     var book = new Good(12.49, GoodType.Book);
     Assert.Equal(12.49, book.GetPrice(), _comparer);
 }