You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.5 KiB
47 lines
1.5 KiB
1 month ago
|
using ProtoCSStruct;
|
||
|
|
||
|
namespace Sog
|
||
|
{
|
||
|
public static class HeroPropUtils
|
||
|
{
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
// 根据 roleData 来填充 heroInfo, 过程中会重算所有属性
|
||
|
// roleData: 保存了每个属性模块的原始信息
|
||
|
// nowSec : 当前时间, 用于计算装备附魔是否有效
|
||
|
public static void FillHeroInfo(ref HeroInfo heroInfo, ref DBRoleData roleData ,MainlandType mainlandType = MainlandType.Min)
|
||
|
{
|
||
|
FillHeroInfoBase(ref heroInfo, ref roleData);
|
||
|
|
||
|
|
||
|
FillHeroInfoProp(ref heroInfo, ref roleData.Knight.PropView);
|
||
|
|
||
|
}
|
||
|
|
||
|
// 根据 roleData 填充 heroInfo 中的基础信息, 跳过属性计算, 提高效率
|
||
|
public static void FillHeroInfoBase(ref HeroInfo heroInfo, ref DBRoleData roleData,MainlandType mainlandType = MainlandType.Min)
|
||
|
{
|
||
|
heroInfo.Dbhero.CopyFrom(ref roleData.Knight.DbHero);
|
||
|
heroInfo.Talent.CopyFrom(ref roleData.Talent);
|
||
|
heroInfo.Win.CopyFrom(ref roleData.WingData);
|
||
|
}
|
||
|
|
||
|
// 根据 heroProp 填充 heroInfo 中的属性展示信息
|
||
|
public static void FillHeroInfoProp(ref HeroInfo heroInfo, ref HeroPropView heroProp)
|
||
|
{
|
||
|
// 外观显示数据
|
||
|
//heroInfo.ShowInfo.DescId = heroInfo.Dbhero.DescId;
|
||
|
//heroInfo.ShowInfo.Pos = heroInfo.LineupPos;
|
||
|
//heroInfo.ShowInfo.ShowEquip.CopyFrom(ref heroInfo.Dbhero.ShowEquip);
|
||
|
heroInfo.PropView.CopyFrom(ref heroProp);
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|