namespace ET.Server
{
    /// <summary>
    /// 玩家工具类
    /// </summary>
    public static class PlayerHelper
    {
        /// <summary>
        /// 玩家基础信息转proto
        /// </summary>
        /// <param name="playerInfo"></param>
        /// <returns></returns>
        public static PlayerBasic PlayerInfoToPlayerBasicProto(PlayerInfo playerInfo)
        {
            return new PlayerBasic()
            {
                id = playerInfo.Id,
                roomId = playerInfo.RoomId.ToString(),
                name = playerInfo.Name,
                level = playerInfo.Level,
                exp = playerInfo.Exp,
            };
        }

        /// <summary>
        /// 玩家信息转proto
        /// </summary>
        /// <param name="player"></param>
        /// <returns></returns>
        public static Player PlayerInfoToProto(WNPlayer player)
        {
            return new Player()
            {
                id = player.GetId(),
                roomId = player.GetRoomId().ToString(),
                name = player.GetName(),
                level = player.GetLevel(),
                exp = player.GetExp(),
                vip = 0,
                hp = 1000,
                mp = 0,
                fightPower = 5,
                gold = player.GetGold(),
                diamond = 77,
                energy = 0,
            };
        }

    }
}