示例#1
0
 public void BuyBoosters()
 {
     if (isActive)
     {
         libraryMenu.windowWarning.Show(TextStrings.GetString("booster_is_active"));
     }
     else
     {
         if (Bank.GetFreeBooster(boosterNum) > 0)
         {
             lastDateTime = System.DateTime.Now;
             PreferencesSaver.SetBoosterActivateTime(boosterNum, lastDateTime);
             Bank.MinusFreeBooster(boosterNum, 1);
         }
         else
         {
             if (BoosterValues.BoosterCost[boosterNum] > Bank.GetMoney())
             {
                 libraryMenu.windowWarning.Show(TextStrings.GetString("no_money"));
             }
             else
             {
                 lastDateTime = System.DateTime.Now;
                 PreferencesSaver.SetBoosterActivateTime(boosterNum, lastDateTime);
                 Bank.MinusMoney(BoosterValues.BoosterCost[boosterNum]);
             }
         }
     }
 }