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 WpfApp2 { /// /// Логика взаимодействия для MainWindow.xaml /// public partial class MainWindow : Window { long point = 0; 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(); Update(); } public void Update() { poi.Content = "Likes: " + point; cli.Content = "Likes per click: " + click; b1.Content = (sol_b1).ToString(); b2.Content = (sol_b2).ToString(); } private void Image_MouseDown(object sender, MouseButtonEventArgs e) { point += click; Update(); } private void Button_Click(object sender, RoutedEventArgs e) { int p = Convert.ToInt32(point); click1(p); } private void Button_Click_1(object sender, RoutedEventArgs e) { int p = Convert.ToInt32(point); click2(p); } private void Button_Click_2(object sender, RoutedEventArgs e) { Application.Current.Shutdown(); } public bool click1(int pi) { point = pi; if (point >= (sol_b1)) { point -= Convert.ToInt64(Math.Round(sol_b1)); click += 3; Update(); return true; } else { return false; } } public bool click2(int pi) { point = pi; if (point >= (sol_b1)) { point -= Convert.ToInt64(Math.Round(sol_b2)); click += 15; Update(); return true; } else { return false; } } } }