using System.Collections.Generic; using asap.core; using Assets.Scripts.UI.AdWheel; using cfg; using game; using Newtonsoft.Json; namespace UI.HookWheel { public class HookWheelData : AEventData { private List _currentProgress; public int CurrentRoundCount; public List CurrentProgress => _currentProgress ??= new List(); public override void RefreshCache() { base.RefreshCache(); CurrentProgress?.Clear(); } public override void SetData(IEventData idata) { if (idata is not HookWheelData data) return; _currentProgress = data._currentProgress; CurrentRoundCount = data.CurrentRoundCount; EventID = data.EventID; InflationRate = data.InflationRate; } #region json ignore [JsonIgnore] public EventHookWheelMain WheelMain => Tables.TbEventHookWheelMain.GetOrDefault(FishingEvent?.RedirectID ?? 0); [JsonIgnore] public override bool IsActive => base.IsActive && CurrentRoundCount < WheelMain.PackManagerID.Count &&((!AdWheelData?.IsActive??false)||IsForceActive); [JsonIgnore] public bool IsForceActive =false; [JsonIgnore] public int CurrentProgressCount => CurrentProgress?.Count ?? 0; [JsonIgnore] private List _showProgress; [JsonIgnore] public List ShowProgress { get { if (_showProgress != null) return _showProgress; _showProgress = new List(); _showProgress.AddRange(_currentProgress); return _showProgress; } set => _showProgress = value; } [JsonIgnore] public bool IsRoundCompleted = false; [JsonIgnore] private AdWheelManager _adWheelManager; [JsonIgnore] private AdWheelManager AdWheelManager =>_adWheelManager??=GContext.container.Resolve(); [JsonIgnore] private AdWheelData AdWheelData => AdWheelManager.Data; #endregion json ignore } }