Playable.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using LC.Newtonsoft.Json;
  2. using TapTap.AntiAddiction.Model;
  3. namespace TapTap.AntiAddiction
  4. {
  5. public class PlayableResult
  6. {
  7. internal static readonly int ADULT = 0;
  8. internal static readonly int NIGHT_STRICT = 1;
  9. internal static readonly int TIME_LIMIT = 2;
  10. private static readonly int MAX_VIETNAM_REMAIN_TIME = 180;
  11. private static readonly int MAX_CHINA_REMAIN_TIME = 60;
  12. /// <summary>
  13. /// 单日游戏最大剩余时间(分钟)
  14. /// </summary>
  15. internal static int MaxRemainTime
  16. {
  17. get
  18. {
  19. if (TapTapAntiAddictionManager.AntiAddictionConfig.region == Region.Vietnam)
  20. return MAX_VIETNAM_REMAIN_TIME;
  21. return MAX_CHINA_REMAIN_TIME;
  22. }
  23. }
  24. /// <summary>
  25. /// 限制类型,
  26. /// 0: 成年人,无限制
  27. /// 1: 宵禁
  28. /// 2: 时长
  29. /// </summary>
  30. [JsonProperty("restrict_type")]
  31. public int RestrictType { get; internal set; }
  32. /// <summary>
  33. /// 是否可玩
  34. /// </summary>
  35. [JsonProperty("can_play")]
  36. public bool CanPlay { get; internal set; }
  37. /// <summary>
  38. /// 剩余时长,用于 UI 展示
  39. /// </summary>
  40. [JsonProperty("remain_time")]
  41. public int RemainTime { get; internal set; }
  42. /// <summary>
  43. /// 游玩时间
  44. /// </summary>
  45. [JsonProperty("cost_time")]
  46. public int CostTime { get; internal set; }
  47. /// <summary>
  48. /// 标题,用于 UI 展示
  49. /// </summary>
  50. [JsonProperty("title")]
  51. public string Title { get; internal set; }
  52. /// <summary>
  53. /// 内容,用于 UI 展示
  54. /// </summary>
  55. [JsonProperty("description")]
  56. public string Content { get; internal set; }
  57. /// <summary>
  58. /// 判断是否是成年人
  59. /// </summary>
  60. public bool IsAdult => RestrictType == ADULT;
  61. }
  62. internal class PlayableResponse : BaseResponse
  63. {
  64. [JsonProperty("data")]
  65. public PlayableResult Result;
  66. }
  67. }