public WeihuaGames.ClientClass.FriendCampaignPosition FromProtobuf(com.kodgames.corgi.protocol.FriendCampaignPosition friendCampaignPosition) { if (friendCampaignPosition != null) { WeihuaGames.ClientClass.Player player = new WeihuaGames.ClientClass.Player(); player.FromProtobuf(friendCampaignPosition.player); this.player = player; this.totalLeftHpPercent = friendCampaignPosition.totalLeftHpPercent; this.locations.Clear(); foreach (com.kodgames.corgi.protocol.Location location in friendCampaignPosition.locations) { WeihuaGames.ClientClass.Location item = new WeihuaGames.ClientClass.Location(); item.FromProtobuf(location); this.locations.Add(item); } this.avatarHpInfos.Clear(); foreach (com.kodgames.corgi.protocol.HpInfo info in friendCampaignPosition.avatarHpInfos) { WeihuaGames.ClientClass.HpInfo info2 = new WeihuaGames.ClientClass.HpInfo(); info2.FromProtobuf(info); this.avatarHpInfos.Add(info2); } } return(this); }
public WeihuaGames.ClientClass.StageInfo FromProtobuf(com.kodgames.corgi.protocol.StageInfo stageInfo) { if (stageInfo != null) { this.index = stageInfo.index; this.eventType = stageInfo.eventType; this.status = stageInfo.status; this.iconId = stageInfo.iconId; this.name = stageInfo.name; this.difficult = stageInfo.difficult; if (stageInfo.showRewards != null) { this.showRewards = stageInfo.showRewards; } if (stageInfo.extraShowRewards != null) { this.extraShowRewards = stageInfo.extraShowRewards; } if (stageInfo.player != null) { WeihuaGames.ClientClass.Player player = new WeihuaGames.ClientClass.Player(); player.FromProtobuf(stageInfo.player); this.player = player; } if (stageInfo.avatarHps != null) { this.avatarHps = stageInfo.avatarHps; } } return(this); }