MainWindow.xaml.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. namespace Cliker
  16. {
  17. /// <summary>
  18. /// Логика взаимодействия для MainWindow.xaml
  19. /// </summary>
  20. public partial class MainWindow : Window
  21. {
  22. long point = 1;
  23. static int click = 1;
  24. double sol_b1 = 25;
  25. double sol_b2 = 50;
  26. double sol_b3 = 75;
  27. double sol_b4 = 100;
  28. public MainWindow()
  29. {
  30. InitializeComponent();
  31. }
  32. public void Update()
  33. {
  34. OYIP.Content = point;
  35. YPC.Content = click;
  36. Price_IIPF.Content = (sol_b1).ToString();
  37. Price_IIPS.Content = (sol_b2).ToString();
  38. Price_IIPE.Content = (sol_b3).ToString();
  39. Price_IIPT.Content = (sol_b4).ToString();
  40. }
  41. private void Image_MouseDown(object sender, MouseButtonEventArgs e)
  42. {
  43. point += click;
  44. Update();
  45. }
  46. private void Upgrade4(object sender, RoutedEventArgs e)
  47. {
  48. if (point >= (sol_b1))
  49. {
  50. point -= Convert.ToInt64(Math.Round(sol_b1));
  51. click += 4;
  52. Update();
  53. }
  54. }
  55. private void Upgrade6(object sender, RoutedEventArgs e)
  56. {
  57. if (point >= (sol_b2))
  58. {
  59. point -= Convert.ToInt64(Math.Round(sol_b2));
  60. click += 6;
  61. Update();
  62. }
  63. }
  64. private void Upgrade8(object sender, RoutedEventArgs e)
  65. {
  66. if (point >= (sol_b3))
  67. {
  68. point -= Convert.ToInt64(Math.Round(sol_b3));
  69. click += 8;
  70. Update();
  71. }
  72. }
  73. private void Upgrade10(object sender, RoutedEventArgs e)
  74. {
  75. if (point >= (sol_b4))
  76. {
  77. point -= Convert.ToInt64(Math.Round(sol_b4));
  78. click += 10;
  79. Update();
  80. }
  81. }
  82. private void Button_Click(object sender, RoutedEventArgs e)
  83. {
  84. Application.Current.Shutdown();
  85. }
  86. }
  87. }