namespace ET.Server
{
///
/// 玩家工具类
///
public static class PlayerHelper
{
///
/// 玩家基础信息转proto
///
///
///
public static PlayerBasic PlayerInfoToPlayerBasicProto(PlayerInfo playerInfo)
{
return new PlayerBasic()
{
id = playerInfo.Id,
name = playerInfo.Name,
level = playerInfo.Level,
exp = playerInfo.Exp,
};
}
///
/// 玩家信息转proto
///
///
///
public static Player PlayerInfoToProto(WNPlayer player)
{
return new Player()
{
id = player.GetId(),
name = player.GetName(),
level = player.GetLevel(),
exp = player.GetExp(),
vip = 0,
hp = 1000,
mp = 0,
fightPower = 5,
gold = player.GetGold(),
diamond = 77,
energy = 0,
};
}
}
}