IP_pos.cs 880 B

1234567891011121314151617181920212223242526272829
  1. using System.Collections.Generic;
  2. public static class AirdropAccuracy
  3. {
  4. private static readonly Dictionary<string, double> TypeToIpMapping = new Dictionary<string, double>
  5. {
  6. {"小型直升机", 1.0},
  7. {"中型直升机", 0.93},
  8. {"大型直升机", 0.87},
  9. {"多引擎水陆两栖飞机", 1},
  10. {"单引擎水陆两栖飞机", 1},
  11. {"单引擎灭火飞机", 0.8},
  12. {"大型灭火飞机", 0.74},
  13. {"超大型灭火飞机", 0.76},
  14. };
  15. public static double GetIpForType(string type)
  16. {
  17. if (TypeToIpMapping.TryGetValue(type, out double ip))
  18. {
  19. return ip;
  20. }
  21. else
  22. {
  23. // 如果类型不匹配,可以返回一个默认值或抛出异常
  24. return 0; // 或者 throw new ArgumentException($"Unsupported type: {type}");
  25. }
  26. }
  27. }