using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WSUniversalLib
{
    public class Calculation
    {
        public int GetPriorityForAgent(int agentType, float age, float experience)
        {
            int result = -1;
            float agentCoefficient;
            switch (agentType)
            {
                case 1:
                    agentCoefficient = 1.8f;
                    if (age <= 25 && experience <= 3)
                        agentCoefficient += 0.1f;
                    break;
                case 2:
                    agentCoefficient = 3.2f;
                    if (age <= 25 && experience <= 3)
                        agentCoefficient += 0.17f;
                    break;
                case 3:
                    agentCoefficient = 4.1f;
                    if (age <= 25 && experience <= 3)
                        agentCoefficient += 0.26f;
                    break;
                default:
                    agentCoefficient = 0;
                    break;
            }
            if (agentCoefficient != 0 && age > 0 && experience > 0 && age < 130 && experience < age)
            {
                if (experience > 10 && experience < 20)
                    agentCoefficient += 0.5f;
                else if (experience > 20 && experience < 40)
                    agentCoefficient += 0.7f;
                else if (experience > 40)
                    agentCoefficient += 0.9f;
                result = (int)Math.Round(agentCoefficient * experience);
            }

            return result;
        }
    }
}
