public void MergeFrom(VaultItem other) { if (other == null) { return; } if (other.Id.Length != 0) { Id = other.Id; } if (other.Cap != 0L) { Cap = other.Cap; } if (other.RelativeValue != 0) { RelativeValue = other.RelativeValue; } if (other.VaultCategoryGmtId.Length != 0) { VaultCategoryGmtId = other.VaultCategoryGmtId; } switch (other.VaultItemTypeCase) { case VaultItemTypeOneofCase.CurrencyItem: if (CurrencyItem == null) { CurrencyItem = new global::WUProtos.Data.CurrencyVaultItem(); } CurrencyItem.MergeFrom(other.CurrencyItem); break; case VaultItemTypeOneofCase.StaminaItem: if (StaminaItem == null) { StaminaItem = new global::WUProtos.Data.StaminaVaultItem(); } StaminaItem.MergeFrom(other.StaminaItem); break; case VaultItemTypeOneofCase.DetectorItem: if (DetectorItem == null) { DetectorItem = new global::WUProtos.Data.DarkDetectorVaultItem(); } DetectorItem.MergeFrom(other.DetectorItem); break; case VaultItemTypeOneofCase.ContainerItem: if (ContainerItem == null) { ContainerItem = new global::WUProtos.Data.ContainerVaultItem(); } ContainerItem.MergeFrom(other.ContainerItem); break; case VaultItemTypeOneofCase.RunestoneItem: if (RunestoneItem == null) { RunestoneItem = new global::WUProtos.Data.RunestoneVaultItem(); } RunestoneItem.MergeFrom(other.RunestoneItem); break; case VaultItemTypeOneofCase.PotionItem: if (PotionItem == null) { PotionItem = new global::WUProtos.Data.Potion.PotionVaultItem(); } PotionItem.MergeFrom(other.PotionItem); break; case VaultItemTypeOneofCase.PotionIngredient: if (PotionIngredient == null) { PotionIngredient = new global::WUProtos.Data.Potion.PotionIngredientVaultItem(); } PotionIngredient.MergeFrom(other.PotionIngredient); break; case VaultItemTypeOneofCase.EnergyItem: if (EnergyItem == null) { EnergyItem = new global::WUProtos.Data.EnergyVaultItem(); } EnergyItem.MergeFrom(other.EnergyItem); break; case VaultItemTypeOneofCase.CauldronTimeItem: if (CauldronTimeItem == null) { CauldronTimeItem = new global::WUProtos.Data.CauldronTimeItem(); } CauldronTimeItem.MergeFrom(other.CauldronTimeItem); break; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); }
public override int GetHashCode() { int hash = 1; if (Id.Length != 0) { hash ^= Id.GetHashCode(); } if (vaultItemTypeCase_ == VaultItemTypeOneofCase.CurrencyItem) { hash ^= CurrencyItem.GetHashCode(); } if (vaultItemTypeCase_ == VaultItemTypeOneofCase.StaminaItem) { hash ^= StaminaItem.GetHashCode(); } if (vaultItemTypeCase_ == VaultItemTypeOneofCase.DetectorItem) { hash ^= DetectorItem.GetHashCode(); } if (vaultItemTypeCase_ == VaultItemTypeOneofCase.ContainerItem) { hash ^= ContainerItem.GetHashCode(); } if (vaultItemTypeCase_ == VaultItemTypeOneofCase.RunestoneItem) { hash ^= RunestoneItem.GetHashCode(); } if (vaultItemTypeCase_ == VaultItemTypeOneofCase.PotionItem) { hash ^= PotionItem.GetHashCode(); } if (vaultItemTypeCase_ == VaultItemTypeOneofCase.PotionIngredient) { hash ^= PotionIngredient.GetHashCode(); } if (vaultItemTypeCase_ == VaultItemTypeOneofCase.EnergyItem) { hash ^= EnergyItem.GetHashCode(); } if (vaultItemTypeCase_ == VaultItemTypeOneofCase.CauldronTimeItem) { hash ^= CauldronTimeItem.GetHashCode(); } if (Cap != 0L) { hash ^= Cap.GetHashCode(); } if (RelativeValue != 0) { hash ^= RelativeValue.GetHashCode(); } if (VaultCategoryGmtId.Length != 0) { hash ^= VaultCategoryGmtId.GetHashCode(); } hash ^= (int)vaultItemTypeCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }