using System; using System.Collections.Generic; using LitJson; using UnityEngine; namespace Wizard; public class MyRotationAllInfo { public class PeriodData { public double StartUnixTime { get; set; } public double EndUnixTime { get; set; } } private Dictionary _myRotationDictionary = new Dictionary(); public PeriodData FreeMatchPeriod = new PeriodData(); private bool _myRotationScheduleExist; private float _receiveSinceTime; private double _receiveServerUnixTime; public List MyRotationInfoList { get; } = new List(); public List AbilityGroup { get; private set; } = new List(); public List DisableCardPackIdList { get; private set; } = new List(); public bool IsMyRotationEnable => IsWithinPeriod(FreeMatchPeriod); public MyRotationInfo Get(string id) { if (string.IsNullOrEmpty(id)) { return null; } if (_myRotationDictionary.TryGetValue(id, out var value)) { return value; } return null; } private bool IsWithinPeriod(PeriodData period) { if (!_myRotationScheduleExist) { return false; } double num = _receiveServerUnixTime + (double)Time.realtimeSinceStartup - (double)_receiveSinceTime; if (num >= period.EndUnixTime) { return false; } return num > period.StartUnixTime; } }