123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- 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 experience, float age)
- {
- int priority = -1;
- float agentNum = -1;
- switch (agentType)
- {
- case 1:
- agentNum = 1.8f;
- break;
- case 2:
- agentNum = 3.2f;
- break;
- case 3:
- agentNum = 4.1f;
- break;
- default:
- break;
- }
- if(experience > 10 && agentNum != -1)
- {
- agentNum+= 0.5f;
- }
- else if (experience > 20 && agentNum != -1)
- {
- agentNum += 0.7f;
- }
- else if (experience > 40 && agentNum != -1)
- {
- agentNum += 0.9f;
- }
- else
- {
- agentNum += 0;
- }
- if(age <= 25 && agentNum != -1)
- {
- switch (agentType)
- {
- case 1:
- agentNum += 0.1f;
- break;
- case 2:
- agentNum += 0.17f;
- break;
- case 3:
- agentNum += 0.26f;
- break;
- default:
- break;
- }
- }
- if(agentNum != -1 && experience > 0 && age > 18 && (age - experience) > 18)
- {
- priority = Convert.ToInt32(agentNum * experience);
- }
- return priority;
- }
- }
- }
|