class IntimacyUtil {
  static final List<Map<String, dynamic>> intimacyLevels = [
    {"max": 20.0, "min": 0.0, "name": "初相识"},
    {"max": 40.0, "min": 21.0, "name": "追爱期"},
    {"max": 60.0, "min": 41.0, "name": "暧昧期"},
    {"max": 80.0, "min": 61.0, "name": "恋人"},
    {"max": 90.0, "min": 81.0, "name": "伴侣"},
    {"max": 100.0, "min": 91.0, "name": "老夫老妻"},
  ];

  /// 传入 intimacy 值，返回对应的名称
  static String getIntimacyName(int intimacy) {
    for (var level in intimacyLevels) {
      if (intimacy >= level["min"] && intimacy <= level["max"]) {
        return level["name"];
      }
    }
    return "未知"; // 处理异常情况
  }
}
