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