100 lines
3.3 KiB
C#
100 lines
3.3 KiB
C#
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; }
|
||
/// <summary>
|
||
/// Building脚本中的序号,从0开始
|
||
/// </summary>
|
||
public int TimelineID { get; private set; }
|
||
public int StepCount { get; private set; }
|
||
public string BuildingPrefeb { get; private set; }
|
||
/// <summary>
|
||
/// 不同prefeb转换的时候,上一个timeline播放时间
|
||
/// </summary>
|
||
public float TimelinePlaytime { get; private set; }
|
||
|
||
public string Name_l10n_key { get; }
|
||
|
||
public string NameIndex_l10n_key { get; }
|
||
public string Icon { get; private set; }
|
||
/// <summary>
|
||
/// 对应Drop表主键
|
||
/// </summary>
|
||
public int Reward { get; private set; }
|
||
public System.Collections.Generic.List<int> StepList { get; private set; }
|
||
public string PhotoSwitch { get; private set; }
|
||
/// <summary>
|
||
/// 用于室内关闭lookfar和looknear功能<br/>1 关闭
|
||
/// </summary>
|
||
public int TurnOffFreeLook { get; private set; }
|
||
/// <summary>
|
||
/// 用于室内关闭加速功能<br/>1 关闭
|
||
/// </summary>
|
||
public int TurnOffTimeScale { get; private set; }
|
||
}
|
||
public class TBAreaMM
|
||
{
|
||
public TBAreaMM(List<AreaMmt> DataList)
|
||
{
|
||
_dataMap = new Dictionary<int, AreaMM>();
|
||
_dataList = new List<AreaMM>();
|
||
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<ConstructionArea> DataList)
|
||
{
|
||
_dataMap = new Dictionary<int, AreaMM>();
|
||
_dataList = new List<AreaMM>();
|
||
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<int, AreaMM> _dataMap;
|
||
private readonly List<AreaMM> _dataList;
|
||
public List<AreaMM> DataList => _dataList;
|
||
public Dictionary<int, AreaMM> DataMap => _dataMap;
|
||
|
||
public AreaMM GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
|
||
}
|