1234567891011121314151617181920212223242526272829 |
- using System.Collections.Generic;
- public static class AirdropAccuracy
- {
- private static readonly Dictionary<string, double> TypeToIpMapping = new Dictionary<string, double>
- {
- {"小型直升机", 1.0},
- {"中型直升机", 0.93},
- {"大型直升机", 0.87},
- {"多引擎水陆两栖飞机", 1},
- {"单引擎水陆两栖飞机", 1},
- {"单引擎灭火飞机", 0.8},
- {"大型灭火飞机", 0.74},
- {"超大型灭火飞机", 0.76},
- };
- public static double GetIpForType(string type)
- {
- if (TypeToIpMapping.TryGetValue(type, out double ip))
- {
- return ip;
- }
- else
- {
- // 如果类型不匹配,可以返回一个默认值或抛出异常
- return 0; // 或者 throw new ArgumentException($"Unsupported type: {type}");
- }
- }
- }
|