Example #1
0
 public void MergeFrom(OnlineOrderResponse other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Id.Length != 0)
     {
         Id = other.Id;
     }
     if (other.Loading != false)
     {
         Loading = other.Loading;
     }
     if (other.OfflineFulfillment != false)
     {
         OfflineFulfillment = other.OfflineFulfillment;
     }
     if (other.TrainDescription.Length != 0)
     {
         TrainDescription = other.TrainDescription;
     }
     if (other.railway_ != null)
     {
         if (railway_ == null)
         {
             Railway = new global::G2Rail.Protobuf.Railway();
         }
         Railway.MergeFrom(other.Railway);
     }
     if (other.from_ != null)
     {
         if (from_ == null)
         {
             From = new global::G2Rail.Protobuf.Station();
         }
         From.MergeFrom(other.From);
     }
     if (other.to_ != null)
     {
         if (to_ == null)
         {
             To = new global::G2Rail.Protobuf.Station();
         }
         To.MergeFrom(other.To);
     }
     if (other.Departure.Length != 0)
     {
         Departure = other.Departure;
     }
     if (other.Arrival.Length != 0)
     {
         Arrival = other.Arrival;
     }
     if (other.ticketPrice_ != null)
     {
         if (ticketPrice_ == null)
         {
             TicketPrice = new global::G2Rail.Protobuf.Price();
         }
         TicketPrice.MergeFrom(other.TicketPrice);
     }
     if (other.paymentPrice_ != null)
     {
         if (paymentPrice_ == null)
         {
             PaymentPrice = new global::G2Rail.Protobuf.Price();
         }
         PaymentPrice.MergeFrom(other.PaymentPrice);
     }
     if (other.chargingPrice_ != null)
     {
         if (chargingPrice_ == null)
         {
             ChargingPrice = new global::G2Rail.Protobuf.Price();
         }
         ChargingPrice.MergeFrom(other.ChargingPrice);
     }
     if (other.rebateAmount_ != null)
     {
         if (rebateAmount_ == null)
         {
             RebateAmount = new global::G2Rail.Protobuf.Price();
         }
         RebateAmount.MergeFrom(other.RebateAmount);
     }
     trains_.Add(other.trains_);
     passengers_.Add(other.passengers_);
     tickets_.Add(other.tickets_);
     records_.Add(other.records_);
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Example #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (Loading != false)
            {
                hash ^= Loading.GetHashCode();
            }
            if (OfflineFulfillment != false)
            {
                hash ^= OfflineFulfillment.GetHashCode();
            }
            if (TrainDescription.Length != 0)
            {
                hash ^= TrainDescription.GetHashCode();
            }
            if (railway_ != null)
            {
                hash ^= Railway.GetHashCode();
            }
            if (from_ != null)
            {
                hash ^= From.GetHashCode();
            }
            if (to_ != null)
            {
                hash ^= To.GetHashCode();
            }
            if (Departure.Length != 0)
            {
                hash ^= Departure.GetHashCode();
            }
            if (Arrival.Length != 0)
            {
                hash ^= Arrival.GetHashCode();
            }
            if (ticketPrice_ != null)
            {
                hash ^= TicketPrice.GetHashCode();
            }
            if (paymentPrice_ != null)
            {
                hash ^= PaymentPrice.GetHashCode();
            }
            if (chargingPrice_ != null)
            {
                hash ^= ChargingPrice.GetHashCode();
            }
            if (rebateAmount_ != null)
            {
                hash ^= RebateAmount.GetHashCode();
            }
            hash ^= trains_.GetHashCode();
            hash ^= passengers_.GetHashCode();
            hash ^= tickets_.GetHashCode();
            hash ^= records_.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }