using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
|
|
public class OperationRechargeGiftAct : OperationBase
|
{
|
public List<int> ctgIDs = new List<int>();
|
public List<HAA74_tagMCActBuyCountGiftInfo.tagMCActBuyCountGift> buyCountGifts = new List<HAA74_tagMCActBuyCountGiftInfo.tagMCActBuyCountGift>();
|
public int shopType;
|
|
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 string ToDisplayTimeEx()
|
{
|
var textBuilder = OperationTimeHepler.textBuilder;
|
textBuilder.Length = 0;
|
textBuilder.Append(startDate.ToDisplay(false));
|
textBuilder.Append(string.Format(" {0}:{1}", joinStartHour.ToString("D2"), joinStartMinute.ToString("D2")));
|
if (startDate != endDate)
|
{
|
textBuilder.Append(" - ");
|
textBuilder.Append(endDate.ToDisplay(false));
|
textBuilder.Append(string.Format(" {0}:{1}", joinEndHour.ToString("D2"), joinEndMinute.ToString("D2")));
|
}
|
return textBuilder.ToString();
|
}
|
public override void Reset()
|
{
|
base.Reset();
|
}
|
|
public void ParsePackage(HAA74_tagMCActBuyCountGiftInfo package)
|
{
|
ctgIDs.Clear();
|
buyCountGifts.Clear();
|
for (int i = 0; i < package.CTGIDCount; i++)
|
{
|
ctgIDs.Add(package.CTGIDList[i]);
|
}
|
for (int i = 0; i < package.GiftCount; i++)
|
{
|
buyCountGifts.Add(package.BuyCountGiftList[i]);
|
}
|
shopType = package.ShopType;
|
|
buyCountGifts.Sort(SortCount);
|
}
|
|
|
|
int SortCount(HAA74_tagMCActBuyCountGiftInfo.tagMCActBuyCountGift dataA, HAA74_tagMCActBuyCountGiftInfo.tagMCActBuyCountGift dataB)
|
{
|
return dataA.NeedBuyCount.CompareTo(dataB.NeedBuyCount);
|
}
|
}
|