Ejemplo n.º 1
0
 public void MergeFrom(Variant other)
 {
     if (other == null)
     {
         return;
     }
     if (other.HasBoolValue)
     {
         BoolValue = other.BoolValue;
     }
     if (other.HasIntValue)
     {
         IntValue = other.IntValue;
     }
     if (other.HasFloatValue)
     {
         FloatValue = other.FloatValue;
     }
     if (other.HasStringValue)
     {
         StringValue = other.StringValue;
     }
     if (other.HasBlobValue)
     {
         BlobValue = other.BlobValue;
     }
     if (other.HasMessageValue)
     {
         MessageValue = other.MessageValue;
     }
     if (other.HasFourccValue)
     {
         FourccValue = other.FourccValue;
     }
     if (other.HasUintValue)
     {
         UintValue = other.UintValue;
     }
     if (other.HasEntityIdValue)
     {
         if (!HasEntityIdValue)
         {
             EntityIdValue = new global::Bgs.Protocol.EntityId();
         }
         EntityIdValue.MergeFrom(other.EntityIdValue);
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Ejemplo n.º 2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (HasBoolValue)
            {
                hash ^= BoolValue.GetHashCode();
            }
            if (HasIntValue)
            {
                hash ^= IntValue.GetHashCode();
            }
            if (HasFloatValue)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(FloatValue);
            }
            if (HasStringValue)
            {
                hash ^= StringValue.GetHashCode();
            }
            if (HasBlobValue)
            {
                hash ^= BlobValue.GetHashCode();
            }
            if (HasMessageValue)
            {
                hash ^= MessageValue.GetHashCode();
            }
            if (HasFourccValue)
            {
                hash ^= FourccValue.GetHashCode();
            }
            if (HasUintValue)
            {
                hash ^= UintValue.GetHashCode();
            }
            if (HasEntityIdValue)
            {
                hash ^= EntityIdValue.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }