Files
back_cantanBuilding/Assets/Scripts/MMT/TBAccountMM.cs
2026-05-26 16:15:54 +08:00

104 lines
3.5 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using cfg;
using System.Collections.Generic;
public class AccountMM
{
public AccountMM(Account account)
{
ID = account.ID;
Rewards = account.Rewards;
Icon = account.Icon;
Img = account.Img;
Title = account.Title;
Title_l10n_key = account.Title_l10n_key;
DisplaySwitch = account.DisplaySwitch;
CashMag = account.CashMag;
CashMagLimited = account.CashMagLimited;
EnergyLimit = account.EnergyLimit;
EnergyRecover = account.EnergyRecover;
EventFishCashMag = account.EventFishCashMag;
EventFishDamage = account.EventFishDamage;
AquariumLimit = account.AquariumLimit;
AquariumCashMag = account.AquariumCashMag;
}
public AccountMM(AccountMmt account)
{
ID = account.ID;
Rewards = account.Rewards;
Icon = account.Icon;
Img = account.Img;
Title = account.Title;
Title_l10n_key = account.Title_l10n_key;
DisplaySwitch = account.DisplaySwitch;
CashMag = account.CashMag;
CashMagLimited = account.CashMagLimited;
EnergyLimit = account.EnergyLimit;
EnergyRecover = account.EnergyRecover;
EventFishCashMag = account.EventFishCashMag;
EventFishDamage = account.EventFishDamage;
AquariumLimit = account.AquariumLimit;
AquariumCashMag = account.AquariumCashMag;
}
public int ID { get; private set; }
/// <summary>
/// 对应Drop表主键
/// </summary>
public int Rewards { get; private set; }
/// <summary>
/// 图标名称<br/>Type=1的时候生效
/// </summary>
public string Icon { get; private set; }
/// <summary>
/// 大图
/// </summary>
public string Img { get; private set; }
public string Title { get; private set; }
public string Title_l10n_key { get; }
/// <summary>
/// 若本级有权益投放对应权益显示为1
/// </summary>
public System.Collections.Generic.List<int> DisplaySwitch { get; private set; }
/// <summary>
/// 填等级具体数值读benefits
/// </summary>
public int CashMag { get; private set; }
public int CashMagLimited { get; private set; }
public int EnergyLimit { get; private set; }
public int EnergyRecover { get; private set; }
public int EventFishCashMag { get; private set; }
public int EventFishDamage { get; private set; }
public int AquariumLimit { get; private set; }
public int AquariumCashMag { get; private set; }
}
public class TBAccountMM
{
public TBAccountMM(List<AccountMmt> DataList)
{
_dataMap = new Dictionary<int, AccountMM>();
_dataList = new List<AccountMM>();
for (int i = 0; DataList != null && i < DataList.Count; i++)
{
var accountMM = new AccountMM(DataList[i]);
_dataList.Add(accountMM);
_dataMap.Add(accountMM.ID, accountMM);
}
}
public TBAccountMM(List<Account> DataList)
{
_dataMap = new Dictionary<int, AccountMM>();
_dataList = new List<AccountMM>();
for (int i = 0; DataList != null && i < DataList.Count; i++)
{
var accountMM = new AccountMM(DataList[i]);
_dataList.Add(accountMM);
_dataMap.Add(accountMM.ID, accountMM);
}
}
private readonly Dictionary<int, AccountMM> _dataMap;
private readonly List<AccountMM> _dataList;
public List<AccountMM> DataList => _dataList;
public AccountMM GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
}