少年修仙传客户端代码仓库
hch
3 天以前 600733c8f592cb9e65f2b7a3e110ac1d686e6bfe
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
using vnxbqy.UI;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
 
public class OperationTurntable : OperationBase
{
 
    public int useMoneyType;    // 累计消费货币类型
    public List<uint> useMoneyPrizeList = new List<uint>();    // 累计消费货币奖励次数列表 [奖励第1次所需累计消费货币, 第2次, ...]
    public List<IL_HAA52_tagMCActTurntableInfo.tagMCActTurntableItem> turnItemList = new List<IL_HAA52_tagMCActTurntableInfo.tagMCActTurntableItem>();    // 转盘已确定的物品列表,包含常规物品+极品物品+终极物品,活动开始时,后端直接随机生成常规物品,已确定的物品不包含极品、终极物品时需要先选择才能使用转盘;
    public Dictionary<int, List<int>> itemTypeIndexs = new Dictionary<int, List<int>>(); //库类型对应索引
    public List<IL_HAA52_tagMCActTurntableInfo.tagMCActTurntableItem> goodItemList = new List<IL_HAA52_tagMCActTurntableInfo.tagMCActTurntableItem>();    // 极品物品待选择库,由玩家从库中选择放入转盘的物品;注意此库中的物品编号仅表示在该库中的编号,可能与转盘已确定的物品编号重复,但并不代表同一物品;
    public int goodItemCanChooseCount;    // 极品物品可选择个数
    public List<IL_HAA52_tagMCActTurntableInfo.tagMCActTurntableItem> superItemList = new List<IL_HAA52_tagMCActTurntableInfo.tagMCActTurntableItem>();    // 终极物品待选择库,由玩家从库中选择放入转盘的物品;注意此库中的物品编号仅表示在该库中的编号,可能与转盘已确定的物品编号重复,但并不代表同一物品;
    public int superItemCanChooseCount;    // 终极物品可选择个数
 
    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();
        useMoneyType = 0;
        useMoneyPrizeList.Clear();
        turnItemList.Clear();
        goodItemList.Clear();
        goodItemCanChooseCount = 0;
        superItemList.Clear();
        superItemCanChooseCount = 0;
        itemTypeIndexs.Clear();
    }
 
    public void UpdateTurntable(IL_HAA52_tagMCActTurntableInfo netPack)
    {
        useMoneyType = netPack.UseMoneyType;
        useMoneyPrizeList = new List<uint>(netPack.UseMoneyPrizeList);
        turnItemList = new List<IL_HAA52_tagMCActTurntableInfo.tagMCActTurntableItem>(netPack.TurnItemList);
        goodItemList = new List<IL_HAA52_tagMCActTurntableInfo.tagMCActTurntableItem>(netPack.GoodItemList);
        goodItemCanChooseCount = netPack.GoodItemCanChooseCount;
        superItemList = new List<IL_HAA52_tagMCActTurntableInfo.tagMCActTurntableItem>(netPack.SuperItemList);
        superItemCanChooseCount = netPack.SuperItemCanChooseCount;
 
        itemTypeIndexs.Clear();
        for (int i = 0; i < turnItemList.Count; i++)
        {
            if (!itemTypeIndexs.ContainsKey(turnItemList[i].ItemLibType))
            {
                itemTypeIndexs[turnItemList[i].ItemLibType] = new List<int>();
            }
            itemTypeIndexs[turnItemList[i].ItemLibType].Add(i);
        }
    }
 
    
}