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; }
///
/// 对应Drop表主键
///
public int Rewards { get; private set; }
///
/// 图标名称
Type=1的时候生效
///
public string Icon { get; private set; }
///
/// 大图
///
public string Img { get; private set; }
public string Title { get; private set; }
public string Title_l10n_key { get; }
///
/// 若本级有权益投放,对应权益显示为1
///
public System.Collections.Generic.List DisplaySwitch { get; private set; }
///
/// 填等级,具体数值读benefits
///
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 DataList)
{
_dataMap = new Dictionary();
_dataList = new List();
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 DataList)
{
_dataMap = new Dictionary();
_dataList = new List();
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 _dataMap;
private readonly List _dataList;
public List DataList => _dataList;
public AccountMM GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
}