Files
ft/Client/Assets/Scripts/UI/HookWheel/HookWheelData.cs
2026-06-29 21:18:33 +08:00

67 lines
2.2 KiB
C#

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<int> _currentProgress;
public int CurrentRoundCount;
public List<int> CurrentProgress => _currentProgress ??= new List<int>();
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<int> _showProgress;
[JsonIgnore]
public List<int> ShowProgress
{
get
{
if (_showProgress != null) return _showProgress;
_showProgress = new List<int>();
_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<AdWheelManager>();
[JsonIgnore] private AdWheelData AdWheelData => AdWheelManager.Data;
#endregion json ignore
}
}