74 lines
2.2 KiB
C#
74 lines
2.2 KiB
C#
using cfg.ActorCfg;
|
|
using cfg.CharacterCfg;
|
|
using cfg.VehicleCfg;
|
|
using Framework;
|
|
using NLDPB;
|
|
|
|
namespace Gameplay.LegionBattle
|
|
{
|
|
/// <summary>
|
|
/// 军团战角色数据
|
|
/// </summary>
|
|
public sealed class LegionRoleData
|
|
{
|
|
/// <summary>
|
|
/// 角色的id
|
|
/// </summary>
|
|
public uint ID { get; private set; }
|
|
/// <summary>
|
|
/// 等级
|
|
/// </summary>
|
|
public int Level { get; private set; }
|
|
/// <summary>
|
|
/// 图标
|
|
/// </summary>
|
|
public string IconPath { get; private set; }
|
|
/// <summary>
|
|
/// 职业类型
|
|
/// </summary>
|
|
public Ejob Job { get; private set; }
|
|
/// <summary>
|
|
/// 类型
|
|
/// </summary>
|
|
public ItemType Type { get; private set; }
|
|
|
|
public LegionRoleData(uint id)
|
|
{
|
|
ID = id;
|
|
|
|
DataItem dataItem = TableManager.Instance.Tables.Item.Get((int)ID);
|
|
if (null == dataItem)
|
|
{
|
|
DebugUtil.LogError($"(军团战)没有ID为{ID}的角色或载具");
|
|
return;
|
|
}
|
|
|
|
Type = dataItem.Type;
|
|
switch (Type)
|
|
{
|
|
case ItemType.Character:
|
|
{
|
|
IconPath = CommonUtils.GetDefaultHeadPathByUid(ID);
|
|
DataCharacterAttri dataCharacterAttri = TableManager.Instance.Tables.CharacterAttri.Get((int)ID);
|
|
if (null != dataCharacterAttri)
|
|
Job = dataCharacterAttri.Job;
|
|
}
|
|
break;
|
|
case ItemType.Vehicle:
|
|
{
|
|
Job = Ejob.Job_Vehicle;
|
|
DataVehicle dataVehicle = TableManager.Instance.Tables.VehicleConfig.Get((int)ID);
|
|
if (null != dataVehicle)
|
|
Level = dataVehicle.VehicleLevel;
|
|
IconPath = CommonUtils.GetDefaultVehicleHeadPath(ID);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
public void CopyData(MSG_LB_Character data)
|
|
{
|
|
Level = (int)data.Level;
|
|
}
|
|
}
|
|
} |