Shegotwet/Assets/ResWork/Table/table_shop.cs

54 lines
2.5 KiB
C#

using GUPS.AntiCheat.Protected;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
public enum eInAppInitType { None, Week, One1, One2, Disable_Buy1, Disable_Buy2 }
public enum eShopBuyType { IAP, AD, Coin, Heart }
[Serializable]
public class shoptabledata
{
public string s_ID, s_Name, s_PeakEffective, s_Items, s_Icon;
public eInAppInitType e_InAppInitType;
public eShopBuyType e_BuyType;
ProtectedInt32 _Price; public int n_Price { get { return _Price; } set { _Price = value; _Price.Obfuscate(); } }
ProtectedInt32 _Limit; public int n_Limit { get { return _Limit; } set { _Limit = value; _Limit.Obfuscate(); } }
ProtectedInt32 _RewardHeart; public int n_RewardHeart { get { return _RewardHeart; } set { _RewardHeart = value; _RewardHeart.Obfuscate(); } }
ProtectedInt32 _RewardChatCoin; public int n_RewardChatCoin { get { return _RewardChatCoin; } set { _RewardChatCoin = value; _RewardChatCoin.Obfuscate(); } }
ProtectedInt32 _RewardGacha; public int n_RewardGacha { get { return _RewardGacha; } set { _RewardGacha = value; _RewardGacha.Obfuscate(); } }
ProtectedInt32 _BonusGameRefill; public int n_BonusGameRefill { get { return _BonusGameRefill; } set { _BonusGameRefill = value; _BonusGameRefill.Obfuscate(); } }
ProtectedBool _AdRemove; public bool b_AdRemove { get { return _AdRemove; } set { _AdRemove = value; _AdRemove.Obfuscate(); } }
ProtectedBool _InfinityMiniGame; public bool b_InfinityMiniGame { get { return _InfinityMiniGame; } set { _InfinityMiniGame = value; _InfinityMiniGame.Obfuscate(); } }
ProtectedBool _LuckyGameCharge; public bool b_LuckyGameCharge { get { return _LuckyGameCharge; } set { _LuckyGameCharge = value; _LuckyGameCharge.Obfuscate(); } }
public string Get_Amount()
{
if (n_RewardHeart > 0) return n_RewardHeart.ToString();
if (n_RewardChatCoin > 0) return n_RewardChatCoin.ToString();
if (n_RewardGacha > 0) return n_RewardGacha.ToString();
return "";
}
}
public class table_shop : table_base
{
public static table_shop Ins;
List<shoptabledata> tableDatas;
protected override void Awake()
{
Ins = this;
base.Awake();
}
protected override void Start()
{
tableDatas = JsonConvert.DeserializeObject<List<shoptabledata>>(json_last);
base.Start();
}
public List<shoptabledata> Get_DataList() { return tableDatas; }
public shoptabledata Get_Data(string id) { return Get_DataList().Find(f => f.s_ID.Equals(id)); }
}