Pārlūkot izejas kodu

Добавьте файлы проекта.

Никита 3 gadi atpakaļ
vecāks
revīzija
f183d0a52c

+ 31 - 0
Clicker-2.0.sln

@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31727.386
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Clicker-2.0", "Clicker-2.0\Clicker-2.0.csproj", "{F12A5CD4-62B3-4C9C-88DF-FB23A95B2A84}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTestProject", "UnitTestProject\UnitTestProject.csproj", "{7EA5806D-B3E3-44FA-B9B9-6A81CDEE1ADA}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{F12A5CD4-62B3-4C9C-88DF-FB23A95B2A84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{F12A5CD4-62B3-4C9C-88DF-FB23A95B2A84}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{F12A5CD4-62B3-4C9C-88DF-FB23A95B2A84}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{F12A5CD4-62B3-4C9C-88DF-FB23A95B2A84}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7EA5806D-B3E3-44FA-B9B9-6A81CDEE1ADA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{7EA5806D-B3E3-44FA-B9B9-6A81CDEE1ADA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7EA5806D-B3E3-44FA-B9B9-6A81CDEE1ADA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{7EA5806D-B3E3-44FA-B9B9-6A81CDEE1ADA}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {DF6C1FBB-C4BD-40FE-9F96-3C2BB09D055F}
+	EndGlobalSection
+EndGlobal

+ 6 - 0
Clicker-2.0/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
+    </startup>
+</configuration>

+ 57 - 0
Clicker-2.0/App.xaml

@@ -0,0 +1,57 @@
+<Application x:Class="Clicker_2._0.App"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:local="clr-namespace:Clicker_2._0"
+             StartupUri="MainWindow.xaml">
+    <Application.Resources>
+
+        <Style x:Key="FocusVisual">
+            <Setter Property="Control.Template">
+                <Setter.Value>
+                    <ControlTemplate>
+                        <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+        <SolidColorBrush x:Key="Button.Static.Background" Color="#FFDDDDDD"/>
+        <SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070"/>
+        <SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFBEE6FD"/>
+        <SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1"/>
+        <SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6"/>
+        <SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
+        <SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
+        <SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
+        <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/>
+        <Style x:Key="ButtonStyle" TargetType="{x:Type Button}">
+            <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
+            <Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
+            <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
+            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
+            <Setter Property="BorderThickness" Value="1"/>
+            <Setter Property="HorizontalContentAlignment" Value="Center"/>
+            <Setter Property="VerticalContentAlignment" Value="Center"/>
+            <Setter Property="Padding" Value="1"/>
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="{x:Type Button}">
+                        <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
+                            <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+                        </Border>
+                        <ControlTemplate.Triggers>
+                            <Trigger Property="IsDefaulted" Value="true">
+                                <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
+                            </Trigger>
+                            <Trigger Property="IsEnabled" Value="false">
+                                <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
+                                <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
+                                <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
+                            </Trigger>
+                        </ControlTemplate.Triggers>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+
+    </Application.Resources>
+</Application>

+ 17 - 0
Clicker-2.0/App.xaml.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace Clicker_2._0
+{
+    /// <summary>
+    /// Логика взаимодействия для App.xaml
+    /// </summary>
+    public partial class App : Application
+    {
+    }
+}

+ 116 - 0
Clicker-2.0/Clicker-2.0.csproj

@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{F12A5CD4-62B3-4C9C-88DF-FB23A95B2A84}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>Clicker_2._0</RootNamespace>
+    <AssemblyName>Clicker-2.0</AssemblyName>
+    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <WarningLevel>4</WarningLevel>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xaml">
+      <RequiredTargetFramework>4.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="WindowsBase" />
+    <Reference Include="PresentationCore" />
+    <Reference Include="PresentationFramework" />
+  </ItemGroup>
+  <ItemGroup>
+    <ApplicationDefinition Include="App.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </ApplicationDefinition>
+    <Page Include="MainWindow.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Compile Include="App.xaml.cs">
+      <DependentUpon>App.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="MainWindow.xaml.cs">
+      <DependentUpon>MainWindow.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Images\Yatoro.jpg" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Images\ti10.jpg" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Images\YatoroDnw.jpg" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Images\YatoroWeak.jpg" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Images\YatoroWin.jpg" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Images\gg.jpg" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

BIN
Clicker-2.0/Images/Yatoro.jpg


BIN
Clicker-2.0/Images/YatoroDnw.jpg


BIN
Clicker-2.0/Images/YatoroWeak.jpg


BIN
Clicker-2.0/Images/YatoroWin.jpg


BIN
Clicker-2.0/Images/gg.jpg


BIN
Clicker-2.0/Images/ti10.jpg


+ 69 - 0
Clicker-2.0/MainWindow.xaml

@@ -0,0 +1,69 @@
+<Window x:Class="Clicker_2._0.MainWindow"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:Clicker_2._0"
+        mc:Ignorable="d"
+        Title="MainWindow" Height="550" Width="700" WindowStyle="None" ResizeMode="NoResize">
+    <Grid>
+        <Grid.Background>
+            <ImageBrush ImageSource="Images/ti10.jpg"/>
+        </Grid.Background>
+        
+        <TabControl>
+            <TabItem Header="Clicker">
+                <Grid>
+                    <Grid.Background>
+                        <ImageBrush ImageSource="Images/ti10.jpg"/>
+                    </Grid.Background>
+
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition/>
+                        <ColumnDefinition Width="1.5*"/>
+                        <ColumnDefinition/>
+                    </Grid.ColumnDefinitions>
+                    <Grid.RowDefinitions>
+                        <RowDefinition/>
+                        <RowDefinition Height="2.5*"/>
+                        <RowDefinition/>
+                    </Grid.RowDefinitions>
+
+                    <TextBlock x:Name="poi" Grid.Column="0" Grid.Row="0" Text="Points: " HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="20"/>
+                    <Button Grid.Column="1" Grid.Row="0" Margin="50 20 50 20" Style="{DynamicResource ButtonStyle}" Click="Button_Click">
+                        <Button.Background>
+                            <ImageBrush ImageSource="Images/gg.jpg"/>
+                        </Button.Background>
+                    </Button>
+                    <TextBlock x:Name="cli" Grid.Column="2" Grid.Row="0" Text="PointsPerClick: " HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black" FontSize="20"/>
+
+                    <Border Grid.Column="1" Grid.Row="1" BorderBrush="White" BorderThickness="1">
+                        <Image x:Name="imgYatoro" Source="Images/YatoroWeak.jpg" Stretch="Fill" MouseDown="Image_MouseDown"/>
+                    </Border>
+
+                    <Button x:Name="b1" Grid.Column="0" Grid.Row="2" Margin="30" Content="100" Click="b1_Click"/>
+                    <Grid Grid.Column="1" Grid.Row="2">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition/>
+                            <ColumnDefinition/>
+                        </Grid.ColumnDefinitions>
+
+                        <Button x:Name="b2" Grid.Column="0" Margin="0 28 15 30" Content="1000" Click="b2_Click"/>
+                        <Button x:Name="b3" Grid.Column="1" Margin="15 28 0 30" Content="5000" Click="b3_Click"/>
+                    </Grid>
+                    <Button x:Name="b4" Grid.Column="2" Grid.Row="2" Margin="30" Content="10000" Click="b4_Click"/>
+                    
+                    
+                </Grid>
+            </TabItem>
+            
+            <TabItem Header="Shop" Height="23" Margin="-2.2,-2,-1.6,-0.2" VerticalAlignment="Top">
+                <Grid>
+                    <Grid.Background>
+                        <ImageBrush ImageSource="Images/ti10.jpg"/>
+                    </Grid.Background>
+                </Grid>
+            </TabItem>
+        </TabControl>
+    </Grid>
+</Window>

+ 192 - 0
Clicker-2.0/MainWindow.xaml.cs

@@ -0,0 +1,192 @@
+using System;
+using System.Windows;
+using System.Windows.Input;
+using System.Windows.Media.Imaging;
+
+namespace Clicker_2._0
+{
+    /// <summary>
+    /// Логика взаимодействия для MainWindow.xaml
+    /// </summary>
+    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);
+        double sol_b3 = 30 + 30 * (90 + click * 0.6);
+        double sol_b4 = 40 + 40 * (1200 + click * 0.8);
+
+        public MainWindow()
+        {
+            InitializeComponent();
+        }
+
+        public void Update()
+        {
+            poi.Text = "Points: " + point; // Вывод Points в первый label
+            cli.Text = "Points for click: " + click; // Вывод Points per click во второй label
+            b1.Content = (sol_b1).ToString(); //
+            b2.Content = (sol_b2).ToString(); // Вывод цены Upgrade для Points per click на кнопке 
+            b3.Content = (sol_b3).ToString(); //
+            b4.Content = (sol_b4).ToString(); //
+        }
+
+        // ClickImg
+        private void Image_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            point = IncreasePoint(point, click);
+            Update();
+        }
+
+        public long IncreasePoint(long point, int click)
+        {
+            return point += click;
+        }
+
+        // UpgradeBtn1
+        private void b1_Click(object sender, RoutedEventArgs e)
+        {
+            if (IsUpgraded(point, 1))
+            {
+                point -= Convert.ToInt64(Math.Round(sol_b1));
+                click = IncreaseClick(click, 1);
+                Update();
+                ChangeImage();
+            }
+        }
+
+        // UpgradeBtn2
+        private void b2_Click(object sender, RoutedEventArgs e)
+        {
+            if (IsUpgraded(point, 2))
+            {
+                point -= Convert.ToInt64(Math.Round(sol_b2));
+                click = IncreaseClick(click, 2);
+                Update();
+                ChangeImage();
+            }
+        }
+
+        // UpgradeBtn3
+        private void b3_Click(object sender, RoutedEventArgs e)
+        {
+            if (IsUpgraded(point, 3))
+            {
+                point -= Convert.ToInt64(Math.Round(sol_b3));
+                click = IncreaseClick(click, 3);
+                Update();
+                ChangeImage();
+            }
+        }
+
+        // UpgradeBtn4
+        private void b4_Click(object sender, RoutedEventArgs e)
+        {
+            if (IsUpgraded(point, 4))
+            {
+                point = DecreasePoint(point, 4);
+                click = IncreaseClick(click, 4);
+                Update();
+                ChangeImage();
+            }
+        }
+
+        public long DecreasePoint(long point, int btnLvl)
+        {
+            if (btnLvl == 1)
+            {
+                return point - Convert.ToInt64(Math.Round(sol_b1));
+            }
+            else if (btnLvl == 2)
+            {
+                return point - Convert.ToInt64(Math.Round(sol_b2));
+            }
+            else if (btnLvl == 3)
+            {
+                return point - Convert.ToInt64(Math.Round(sol_b3));
+            }
+            else
+            {
+                return point - Convert.ToInt64(Math.Round(sol_b4));
+            }
+        }
+
+        public int IncreaseClick(int click, int btnLvl)
+        {
+            if (btnLvl == 1)
+            {
+                return click + 3;
+            }
+            else if (btnLvl == 2)
+            {
+                return click + 10;
+            }
+            else if (btnLvl == 3)
+            {
+                return click + 30;
+            }
+            else
+            {
+                return click + 50;
+            }
+        }
+
+        public bool IsUpgraded(long point, int btnLvl)
+        {
+            if (btnLvl == 1)
+            {
+                if (point >= (sol_b1))
+                {
+                    return true;
+                }
+                return false;
+            }
+            else if (btnLvl == 2)
+            {
+                if (point >= (sol_b2))
+                {
+                    return true;
+                }
+                return false;
+            }
+            else if (btnLvl == 3)
+            {
+                if (point >= (sol_b3))
+                {
+                    return true;
+                }
+                return false;
+            }
+            else
+            {
+                if (point >= (sol_b4))
+                {
+                    return true;
+                }
+                return false;
+            }
+        }
+
+        private void ChangeImage()
+        {
+            if (click > 50)
+            {
+                imgYatoro.Source = BitmapFrame.Create(new Uri(@"Images/YatoroWin.jpg"));
+            }
+            else if (click > 30)
+            {
+                imgYatoro.Source = BitmapFrame.Create(new Uri(@"Images/Yatoro.jpg"));
+            }
+            else if (click > 10)
+            {
+                imgYatoro.Source = BitmapFrame.Create(new Uri(@"Images/YatoroDnw.jpg"));
+            }
+        }
+
+        private void Button_Click(object sender, RoutedEventArgs e)
+        {
+            Close();
+        }
+    }
+}

+ 55 - 0
Clicker-2.0/Properties/AssemblyInfo.cs

@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// Общие сведения об этой сборке предоставляются следующим набором
+// набор атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
+// связанные со сборкой.
+[assembly: AssemblyTitle("Clicker-2.0")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Clicker-2.0")]
+[assembly: AssemblyCopyright("Copyright ©  2021")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
+// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
+// из модели COM, установите атрибут ComVisible для этого типа в значение true.
+[assembly: ComVisible(false)]
+
+//Чтобы начать создание локализуемых приложений, задайте
+//<UICulture>CultureYouAreCodingWith</UICulture> в файле .csproj
+//в <PropertyGroup>. Например, при использовании английского (США)
+//в своих исходных файлах установите <UICulture> в en-US.  Затем отмените преобразование в комментарий
+//атрибута NeutralResourceLanguage ниже.  Обновите "en-US" в
+//строка внизу для обеспечения соответствия настройки UICulture в файле проекта.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+    ResourceDictionaryLocation.None, //где расположены словари ресурсов по конкретным тематикам
+                                     //(используется, если ресурс не найден на странице,
+                                     // или в словарях ресурсов приложения)
+    ResourceDictionaryLocation.SourceAssembly //где расположен словарь универсальных ресурсов
+                                              //(используется, если ресурс не найден на странице,
+                                              // в приложении или в каких-либо словарях ресурсов для конкретной темы)
+)]
+
+
+// Сведения о версии для сборки включают четыре следующих значения:
+//
+//      Основной номер версии
+//      Дополнительный номер версии
+//      Номер сборки
+//      Номер редакции
+//
+// Можно задать все значения или принять номера сборки и редакции по умолчанию 
+// используя "*", как показано ниже:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 70 - 0
Clicker-2.0/Properties/Resources.Designer.cs

@@ -0,0 +1,70 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код был создан программным средством.
+//     Версия среды выполнения: 4.0.30319.42000
+//
+//     Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если
+//     код создан повторно.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+
+namespace Clicker_2._0.Properties
+{
+    /// <summary>
+    ///   Класс ресурсов со строгим типом для поиска локализованных строк и пр.
+    /// </summary>
+    // Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder
+    // класс с помощью таких средств, как ResGen или Visual Studio.
+    // Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen
+    // с параметром /str или заново постройте свой VS-проект.
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources
+    {
+
+        private static global::System.Resources.ResourceManager resourceMan;
+
+        private static global::System.Globalization.CultureInfo resourceCulture;
+
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources()
+        {
+        }
+
+        /// <summary>
+        ///   Возврат кэшированного экземпляра ResourceManager, используемого этим классом.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager
+        {
+            get
+            {
+                if ((resourceMan == null))
+                {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Clicker_2._0.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+
+        /// <summary>
+        ///   Переопределяет свойство CurrentUICulture текущего потока для всех
+        ///   подстановки ресурсов с помощью этого класса ресурсов со строгим типом.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture
+        {
+            get
+            {
+                return resourceCulture;
+            }
+            set
+            {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 117 - 0
Clicker-2.0/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 29 - 0
Clicker-2.0/Properties/Settings.Designer.cs

@@ -0,0 +1,29 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+
+namespace Clicker_2._0.Properties
+{
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+    {
+
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+        public static Settings Default
+        {
+            get
+            {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 7 - 0
Clicker-2.0/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 20 - 0
UnitTestProject/Properties/AssemblyInfo.cs

@@ -0,0 +1,20 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("UnitTestProject")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("UnitTestProject")]
+[assembly: AssemblyCopyright("Copyright ©  2021")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: ComVisible(false)]
+
+[assembly: Guid("7ea5806d-b3e3-44fa-b9b9-6a81cdee1ada")]
+
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 113 - 0
UnitTestProject/UnitTest1.cs

@@ -0,0 +1,113 @@
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System;
+using Clicker_2._0;
+
+namespace UnitTestProject
+{
+    [TestClass]
+    public class UnitTest1
+    {
+        MainWindow wnd = new MainWindow();
+        long point = 0;
+        static int click = 1;
+
+        [TestMethod]
+        public void ClickImgTest()
+        {
+            // 1 
+            long resultPoints = 1;
+            Assert.AreEqual(resultPoints, wnd.IncreasePoint(point, click));
+
+            // 2
+            point = 100;
+            click = 3;
+            resultPoints = 103;
+            Assert.AreEqual(resultPoints, wnd.IncreasePoint(point, click));
+
+            // 3
+            point = 123;
+            click = 17;
+            resultPoints = 140;
+            Assert.AreEqual(resultPoints, wnd.IncreasePoint(point, click));
+
+            // 4
+            point = 15;
+            click = 15;
+            resultPoints = 30;
+            Assert.AreEqual(resultPoints, wnd.IncreasePoint(point, click));
+
+        }
+
+        [TestMethod]
+        public void UpgradeBtn1Test()
+        {
+            // Btn1
+            point = 0;
+            Assert.IsFalse(wnd.IsUpgraded(point, 1));
+            point = 312;
+            Assert.IsTrue(wnd.IsUpgraded(point, 1));
+
+            click = 1;
+            int resultClick = 4;
+            Assert.AreEqual(resultClick, wnd.IncreaseClick(click, 1));
+
+            point = 312;
+            long resultPoint = 0;
+            Assert.AreEqual(resultPoint, wnd.DecreasePoint(point, 1));
+        }
+
+        [TestMethod]
+        public void UpgradeBtn2Test()
+        {
+            // Btn2
+            point = 499;
+            Assert.IsFalse(wnd.IsUpgraded(point, 2));
+            point = 1500;
+            Assert.IsTrue(wnd.IsUpgraded(point, 2));
+
+            click = 10;
+            int resultClick = 20;
+            Assert.AreEqual(resultClick, wnd.IncreaseClick(click, 2));
+
+            point = 2000;
+            long resultPoint = 772;
+            Assert.AreEqual(resultPoint, wnd.DecreasePoint(point, 2));
+        }
+
+        [TestMethod]
+        public void UpgradeBtn3Test()
+        {
+            // Btn3
+            point = 1200;
+            Assert.IsFalse(wnd.IsUpgraded(point, 3));
+            point = 50000;
+            Assert.IsTrue(wnd.IsUpgraded(point, 3));
+
+            click = 20;
+            int resultClick = 50;
+            Assert.AreEqual(resultClick, wnd.IncreaseClick(click, 3));
+
+            point = 50000;
+            long resultPoint = 47252;
+            Assert.AreEqual(resultPoint, wnd.DecreasePoint(point, 3));
+        }
+
+        [TestMethod]
+        public void UpgradeBtn4Test()
+        {
+            // Btn4
+            point = 0;
+            Assert.IsFalse(wnd.IsUpgraded(point, 4));
+            point = 50000;
+            Assert.IsTrue(wnd.IsUpgraded(point, 4));
+
+            click = 50;
+            int resultClick = 100;
+            Assert.AreEqual(resultClick, wnd.IncreaseClick(click, 4));
+
+            point = 50000;
+            long resultPoint = 1928;
+            Assert.AreEqual(resultPoint, wnd.DecreasePoint(point, 4));
+        }
+    }
+}

+ 77 - 0
UnitTestProject/UnitTestProject.csproj

@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props')" />
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{7EA5806D-B3E3-44FA-B9B9-6A81CDEE1ADA}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>UnitTestProject</RootNamespace>
+    <AssemblyName>UnitTestProject</AssemblyName>
+    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
+    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
+    <IsCodedUITest>False</IsCodedUITest>
+    <TestProjectType>UnitTest</TestProjectType>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\MSTest.TestFramework.2.1.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\MSTest.TestFramework.2.1.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
+    </Reference>
+    <Reference Include="PresentationCore" />
+    <Reference Include="PresentationFramework" />
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="WindowsBase" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="UnitTest1.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\Clicker-2.0\Clicker-2.0.csproj">
+      <Project>{f12a5cd4-62b3-4c9c-88df-fb23a95b2a84}</Project>
+      <Name>Clicker-2.0</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>Данный проект ссылается на пакеты NuGet, отсутствующие на этом компьютере. Используйте восстановление пакетов NuGet, чтобы скачать их.  Дополнительную информацию см. по адресу: http://go.microsoft.com/fwlink/?LinkID=322105. Отсутствует следующий файл: {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props'))" />
+    <Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets'))" />
+  </Target>
+  <Import Project="..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets')" />
+</Project>

+ 5 - 0
UnitTestProject/packages.config

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="MSTest.TestAdapter" version="2.1.2" targetFramework="net472" />
+  <package id="MSTest.TestFramework" version="2.1.2" targetFramework="net472" />
+</packages>