少年修仙传客户端代码仓库
hch
2025-04-03 c154ac0832fe4379a00d3e1cda700e7d2a7383c7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
using System.Collections.Generic;
 
namespace vnxbqy.UI
{
    //轮回殿活动
    public class OperationCycleHall : OperationBase
    {
        // <轮回类型, HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianRound>
        public Dictionary<int, HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianRound> roundInfoDict = new Dictionary<int, HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianRound>();
        CycleHallActModel model { get { return ModelCenter.Instance.GetModel<CycleHallActModel>(); } }
        public bool TryGetRound(int roundType, out HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianRound round)
        {
            return roundInfoDict.TryGetValue(roundType, out round);
        }
 
        public bool TryGetRoundInfoByIndex(int roundType, int awardIndex, out HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward awardInfo, out int listIndex)
        {
            listIndex = 0;
            awardInfo = new HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward { };
            if (!TryGetRound(roundType, out var round) || round.AwardList == null)
                return false;
            for (int i = 0; i < round.AwardList.Length; i++)
            {
                if (round.AwardList[i].AwardIndex == awardIndex)
                {
                    awardInfo = round.AwardList[i];
                    listIndex = i;
                    return true;
                }
            }
            return false;
        }
 
        public bool TryGetRoundInfoByNeedValue(int roundType, int needValue, out HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward awardInfo)
        {
            awardInfo = new HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward { };
            if (!TryGetRound(roundType, out var round) || round.AwardList == null)
                return false;
            for (int i = 0; i < round.AwardList.Length; i++)
            {
                if (round.AwardList[i].NeedValue == needValue)
                {
                    awardInfo = round.AwardList[i];
                    return true;
                }
            }
            return true;
        }
 
        public override bool SatisfyOpenCondition()
        {
            return PlayerDatas.Instance.baseData.LV >= limitLv;
        }
 
        public override string ToDisplayTime()
        {
            var textBuilder = OperationTimeHepler.textBuilder;
            textBuilder.Length = 0;
            textBuilder.Append(startDate.ToDisplay());
            if (startDate != endDate)
            {
                textBuilder.Append("—");
                textBuilder.Append(endDate.ToDisplay());
            }
            return textBuilder.ToString();
        }
 
        public override void Reset()
        {
            base.Reset();
            roundInfoDict.Clear();
            model.lastCurRoundDict.Clear();
            model.lastCurValueDict.Clear();
        }
 
        public void ParseCycleHallInfo(HAA88_tagMCActLunhuidianInfo package)
        {
            roundInfoDict.Clear();
            for (int i = 0; i < package.RoundList.Length; i++)
            {
                roundInfoDict[package.RoundList[i].RoundType] = package.RoundList[i];
            }
        }
    }
}