12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace WpfApp1
- {
- /// <summary>
- /// Логика взаимодействия для MainWindow.xaml
- /// </summary>
- public partial class MainWindow : Window
- {
-
- long point = 110;
- static int click = 1;
- double sol_b1 = 10 + 10 * (30 + click * 0.2);
- double sol_b2 = 20 + 20 * (60 + click * 0.4);
- public MainWindow()
- {
- InitializeComponent();
- }
- public void Update()
- {
- Label1.Content="Points: " + point; // Вывод Points в первый label
- Label2.Content = "Points for click: " + click; // Вывод Points per click во второй label
- Button1.Content = (sol_b1).ToString(); //
- Button2.Content = (sol_b2).ToString(); // Вывод цены Upgrade для Points per click на кнопке
- }
- private void Image_MouseDown(object sender, MouseButtonEventArgs e)
- {
- point += click;
- Update();
- }
- private void Button1_Click(object sender, RoutedEventArgs e)
- {
- if (point >= (sol_b1))
- {
- point -= Convert.ToInt64(Math.Round(sol_b1));
- click += 3;
- Update();
- }
- }
- private void Button2_Click(object sender, RoutedEventArgs e)
- {
- if (point >= (sol_b2))
- {
- point -= Convert.ToInt64(Math.Round(sol_b2));
- click += 7;
- Update();
- }
- }
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- Application.Current.Shutdown();
- }
- public bool Test(double sol_b1,double sol_b2)
- {
-
- if (sol_b1 == 312 && sol_b2 == 1228)
- {
- return true;
- }
- else { return false; }
- }
- }
- }
|