Browse Source

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

15 2 years ago
parent
commit
6753eb8fbe
4 changed files with 174 additions and 0 deletions
  1. 53 0
      Class1.cs
  2. 36 0
      Properties/AssemblyInfo.cs
  3. 54 0
      WSUniversalLib.csproj
  4. 31 0
      WSUniversalLib.sln

+ 53 - 0
Class1.cs

@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WSUniversalLib
+{
+    public class Calculation
+    {
+        public static int GetPriorityForAgent(int agentType, float age, float experience)
+        {
+            float[] agentKoef = { 0, 1.8F, 3.2F, 4.1F };
+            float[] agentKoefYoung = { 0, 1.9F, 3.37F, 4.36F };
+            float[] agentKoefOlder10 = { 0, 2.3F, 3.7F, 4.6F };
+            float[] agentKoefOlder20 = { 0, 2.5F, 3.9F, 4.8F };
+            float[] agentKoefOlder40 = { 0, 2.7F, 4.1F, 5.0F };
+
+            int priority = 0;
+
+            if (agentType <= 0 || age <= 0 || experience <= 0)
+            {
+                return -1;
+            }
+
+            if(age < 25 && experience < 3)
+            {
+                priority = Convert.ToInt32(Math.Round(experience* agentKoefYoung[agentType]));
+                return priority;
+            }
+            if (experience >= 10 && experience < 20)
+            {
+                priority = Convert.ToInt32(Math.Round(experience * agentKoefOlder10[agentType]));
+                return priority;
+            }
+            if (experience >= 20 && experience < 40)
+            {
+                priority = Convert.ToInt32(Math.Round(experience * agentKoefOlder20[agentType]));
+                return priority;
+            }
+            if (experience >= 40)
+            {
+                priority = Convert.ToInt32(Math.Round(experience * agentKoefOlder40[agentType]));
+                return priority;
+            }
+            else
+            {
+                priority = Convert.ToInt32(Math.Round(experience * agentKoef[agentType]));
+                return priority;
+            }
+        }
+    }
+}

+ 36 - 0
Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Общие сведения об этой сборке предоставляются следующим набором
+// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
+// связанные со сборкой.
+[assembly: AssemblyTitle("WSUniversalLib")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("WSUniversalLib")]
+[assembly: AssemblyCopyright("Copyright ©  2022")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
+// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
+// COM, задайте атрибуту ComVisible значение TRUE для этого типа.
+[assembly: ComVisible(false)]
+
+// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
+[assembly: Guid("fa54a66a-0e77-462e-8f16-a6a09ef962db")]
+
+// Сведения о версии сборки состоят из указанных ниже четырех значений:
+//
+//      Основной номер версии
+//      Дополнительный номер версии
+//      Номер сборки
+//      Редакция
+//
+// Можно задать все значения или принять номера сборки и редакции по умолчанию 
+// используя "*", как показано ниже:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 54 - 0
WSUniversalLib.csproj

@@ -0,0 +1,54 @@
+<?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>fa54a66a-0e77-462e-8f16-a6a09ef962db</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>WSUniversalLib</RootNamespace>
+    <AssemblyName>WSUniversalLib</AssemblyName>
+    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </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="System"/>
+    
+    <Reference Include="System.Core"/>
+    <Reference Include="System.Xml.Linq"/>
+    <Reference Include="System.Data.DataSetExtensions"/>
+    
+    
+    <Reference Include="Microsoft.CSharp"/>
+    
+    <Reference Include="System.Data"/>
+    
+    <Reference Include="System.Net.Http"/>
+    
+    <Reference Include="System.Xml"/>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Class1.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ </Project>

+ 31 - 0
WSUniversalLib.sln

@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30804.86
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WSUniversalLib", "WSUniversalLib.csproj", "{FA54A66A-0E77-462E-8F16-A6A09EF962DB}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WSUniversalLibTests", "..\WSUniversalLibTests\WSUniversalLibTests.csproj", "{ABF016F9-571A-486A-87C9-1C62E3E1CE12}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{FA54A66A-0E77-462E-8F16-A6A09EF962DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{FA54A66A-0E77-462E-8F16-A6A09EF962DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{FA54A66A-0E77-462E-8F16-A6A09EF962DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{FA54A66A-0E77-462E-8F16-A6A09EF962DB}.Release|Any CPU.Build.0 = Release|Any CPU
+		{ABF016F9-571A-486A-87C9-1C62E3E1CE12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{ABF016F9-571A-486A-87C9-1C62E3E1CE12}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{ABF016F9-571A-486A-87C9-1C62E3E1CE12}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{ABF016F9-571A-486A-87C9-1C62E3E1CE12}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {00CDE124-F4F5-4F05-ADB5-703CE8230DC8}
+	EndGlobalSection
+EndGlobal