43 lines
1.5 KiB
C#
43 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace ServerCommon;
|
|
|
|
public static class MessgaeHelper
|
|
{
|
|
public static AvatarInfo toCharacterAppearanceProfile4Client( this CharacterAttribute.AppearanceProfile appearanceProfile )
|
|
{
|
|
var avatar_info = new AvatarInfo();
|
|
var appearance_customize = new AppearanceCustomization();
|
|
avatar_info.AppearCustomize = appearance_customize;
|
|
|
|
appearance_customize.BasicStyle = (int)appearanceProfile.BasicStyle;
|
|
appearance_customize.BodyShape = (int)appearanceProfile.BodyShape;
|
|
appearance_customize.HairStyle = (int)appearanceProfile.HairStyle;
|
|
appearance_customize.CustomValues.AddRange(appearanceProfile.CustomValues.Select( x => x ).ToList());
|
|
|
|
avatar_info.Init = (uint)((true == appearanceProfile.IsCustomCompleted) ? 0 : 1);
|
|
|
|
|
|
return avatar_info;
|
|
}
|
|
|
|
public static AppearanceCustomization toCharacterAppearanceCustomize4Client(this CharacterAttribute.AppearanceProfile appearanceProfile)
|
|
{
|
|
var appearance_customize = new AppearanceCustomization();
|
|
|
|
appearance_customize.BasicStyle = (int)appearanceProfile.BasicStyle;
|
|
appearance_customize.BodyShape = (int)appearanceProfile.BodyShape;
|
|
appearance_customize.HairStyle = (int)appearanceProfile.HairStyle;
|
|
appearance_customize.CustomValues.AddRange(appearanceProfile.CustomValues.Select(x => x).ToList());
|
|
|
|
return appearance_customize;
|
|
}
|
|
}
|