using cfg;
using System.Collections.Generic;
public class AreaMM
{
public AreaMM(AreaMmt area)
{
ID = area.ID;
TimelineID = area.TimelineID;
StepCount = area.StepCount;
BuildingPrefeb = area.BuildingPrefeb;
TimelinePlaytime = area.TimelinePlaytime;
Name_l10n_key = area.Name_l10n_key;
NameIndex_l10n_key = area.NameIndex_l10n_key;
Icon = area.Icon;
Reward = area.Reward;
StepList = area.StepList;
PhotoSwitch = area.PhotoSwitch;
TurnOffFreeLook = area.TurnOffFreeLook;
TurnOffTimeScale = area.TurnOffTimeScale;
}
public AreaMM(ConstructionArea area)
{
ID = area.ID;
TimelineID = area.TimelineID;
StepCount = area.StepCount;
BuildingPrefeb = area.BuildingPrefeb;
TimelinePlaytime = area.TimelinePlaytime;
Name_l10n_key = area.Name_l10n_key;
NameIndex_l10n_key = area.NameIndex_l10n_key;
Icon = area.Icon;
Reward = area.Reward;
StepList = area.StepList;
TurnOffFreeLook = area.TurnOffFreeLook;
TurnOffTimeScale = area.TurnOffTimeScale;
}
public int ID { get; private set; }
///
/// Building脚本中的序号,从0开始
///
public int TimelineID { get; private set; }
public int StepCount { get; private set; }
public string BuildingPrefeb { get; private set; }
///
/// 不同prefeb转换的时候,上一个timeline播放时间
///
public float TimelinePlaytime { get; private set; }
public string Name_l10n_key { get; }
public string NameIndex_l10n_key { get; }
public string Icon { get; private set; }
///
/// 对应Drop表主键
///
public int Reward { get; private set; }
public System.Collections.Generic.List StepList { get; private set; }
public string PhotoSwitch { get; private set; }
///
/// 用于室内关闭lookfar和looknear功能
1 关闭
///
public int TurnOffFreeLook { get; private set; }
///
/// 用于室内关闭加速功能
1 关闭
///
public int TurnOffTimeScale { get; private set; }
}
public class TBAreaMM
{
public TBAreaMM(List DataList)
{
_dataMap = new Dictionary();
_dataList = new List();
for (int i = 0; DataList != null && i < DataList.Count; i++)
{
var accountMM = new AreaMM(DataList[i]);
_dataList.Add(accountMM);
_dataMap.Add(accountMM.ID, accountMM);
}
}
public TBAreaMM(List DataList)
{
_dataMap = new Dictionary();
_dataList = new List();
for (int i = 0; DataList != null && i < DataList.Count; i++)
{
var accountMM = new AreaMM(DataList[i]);
_dataList.Add(accountMM);
_dataMap.Add(accountMM.ID, accountMM);
}
}
private readonly Dictionary _dataMap;
private readonly List _dataList;
public List DataList => _dataList;
public Dictionary DataMap => _dataMap;
public AreaMM GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
}