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 void FromProtobuf(com.kodgames.corgi.protocol.Position position) { this.positionId = position.positionId; this.employLocationId = position.employLocationId; this.employShowLocationId = position.employShowLocationId; if (position.avatarLocations != null) { foreach (com.kodgames.corgi.protocol.Location location in position.avatarLocations) { WeihuaGames.ClientClass.Location item = new WeihuaGames.ClientClass.Location(); item.FromProtobuf(location); this.avatarLocations.Add(item); } } if (position.equipLocations != null) { foreach (com.kodgames.corgi.protocol.Location location3 in position.equipLocations) { WeihuaGames.ClientClass.Location location4 = new WeihuaGames.ClientClass.Location(); location4.FromProtobuf(location3); this.equipLocations.Add(location4); } } if (position.danLocations != null) { foreach (com.kodgames.corgi.protocol.Location location5 in position.danLocations) { WeihuaGames.ClientClass.Location location6 = new WeihuaGames.ClientClass.Location(); location6.FromProtobuf(location5); this.danLocations.Add(location6); } } if (position.beastLocations != null) { foreach (com.kodgames.corgi.protocol.Location location7 in position.beastLocations) { WeihuaGames.ClientClass.Location location8 = new WeihuaGames.ClientClass.Location(); location8.FromProtobuf(location7); this.beastLocations.Add(location8); } } if (position.skillLocations != null) { foreach (com.kodgames.corgi.protocol.Location location9 in position.skillLocations) { WeihuaGames.ClientClass.Location location10 = new WeihuaGames.ClientClass.Location(); location10.FromProtobuf(location9); this.skillLocations.Add(location10); } } if (position.partners != null) { foreach (com.kodgames.corgi.protocol.Partner partner in position.partners) { WeihuaGames.ClientClass.Partner partner2 = new WeihuaGames.ClientClass.Partner(); partner2.FromProtobuf(partner); this.partners.Add(partner2); } } if (position.pairs != null) { foreach (com.kodgames.corgi.protocol.Pair pair in position.pairs) { Pair pair2 = new Pair(); pair2.FromProtobuf(pair); this.pairs.Add(pair2); } } }