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);
|
}
|
}
|
|
|
}
|