コード例 #1
0
 private void ShopTimer_Tick(object sender, EventArgs e)
 {
     if (tick == 0)
     {
         if (ShopInventar.getShop().Count != 0)
         {
             if (Character.GetGold() >= ShopInventar.getShop()[0].GetPrice())
             {
                 ShopInventar.BoughtArtifact(ShopInventar.getShop()[0]);
             }
             else
             {
                 Character.setBuyed(true);
             }
         }
         tick += 1;
     }
     else if (tick == 1)
     {
         Character.setBuyed(true);
         Button_EXIT_Click(sender, e);
         tick = 0;
     }
     UpdateShop();
 }
コード例 #2
0
 private void Button_Pokypka_Click(object sender, EventArgs e)
 {
     if (Character.GetGold() >= ShopInventar.getShop()[listBox1.SelectedIndex].GetPrice())
     {
         ShopInventar.BoughtArtifact(ShopInventar.getShop()[listBox1.SelectedIndex]);
     }
     UpdateShop();
 }
コード例 #3
0
 private void UpdateShop()
 {
     listBox1.Items.Clear();
     for (int i = 0; i < ShopInventar.getShop().Count; i++)
     {
         listBox1.Items.Add(ShopInventar.getShop()[i].GetName() + " - " + $"Урон: {ShopInventar.getShop()[i].GetDamage()}; Доп.ХП: {ShopInventar.getShop()[i].GetMaxHP()}; Цена: {ShopInventar.getShop()[i].GetPrice()}");
     }
 }
コード例 #4
0
 public Form1()
 {
     InitializeComponent();
     ShopInventar.standard_artifacts();
 }