MainWindow.xaml.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. public MainWindow()
  27. {
  28. InitializeComponent();
  29. }
  30. public void Update()
  31. {
  32. OYIP.Content = point;
  33. YPC.Content = click;
  34. Price_IIPF.Content = (sol_b1).ToString();
  35. Price_IIPS.Content = (sol_b2).ToString();
  36. }
  37. private void Image_MouseDown(object sender, MouseButtonEventArgs e)
  38. {
  39. point += click;
  40. Update();
  41. }
  42. private void Upgrade4(object sender, RoutedEventArgs e)
  43. {
  44. if (point >= (sol_b1))
  45. {
  46. point -= Convert.ToInt64(Math.Round(sol_b1));
  47. click += 4;
  48. Update();
  49. }
  50. }
  51. private void Upgrade6(object sender, RoutedEventArgs e)
  52. {
  53. if (point >= (sol_b2))
  54. {
  55. point -= Convert.ToInt64(Math.Round(sol_b1));
  56. click += 6;
  57. Update();
  58. }
  59. }
  60. private void Button_Click(object sender, RoutedEventArgs e)
  61. {
  62. Application.Current.Shutdown();
  63. }
  64. }
  65. }