Exemple #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (requestCase_ == RequestOneofCase.ServerJoinRequest)
            {
                hash ^= ServerJoinRequest.GetHashCode();
            }
            if (requestCase_ == RequestOneofCase.ChatJoinRequest)
            {
                hash ^= ChatJoinRequest.GetHashCode();
            }
            if (requestCase_ == RequestOneofCase.ChatLeaveRequest)
            {
                hash ^= ChatLeaveRequest.GetHashCode();
            }
            if (requestCase_ == RequestOneofCase.NameChangeRequest)
            {
                hash ^= NameChangeRequest.GetHashCode();
            }
            hash ^= (int)requestCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemple #2
0
        public void MergeFrom(Request other)
        {
            if (other == null)
            {
                return;
            }
            switch (other.RequestCase)
            {
            case RequestOneofCase.ServerJoinRequest:
                if (ServerJoinRequest == null)
                {
                    ServerJoinRequest = new global::ChatServer.Transmissions.ServerJoinRequest();
                }
                ServerJoinRequest.MergeFrom(other.ServerJoinRequest);
                break;

            case RequestOneofCase.ChatJoinRequest:
                if (ChatJoinRequest == null)
                {
                    ChatJoinRequest = new global::ChatServer.Transmissions.ChatJoinRequest();
                }
                ChatJoinRequest.MergeFrom(other.ChatJoinRequest);
                break;

            case RequestOneofCase.ChatLeaveRequest:
                if (ChatLeaveRequest == null)
                {
                    ChatLeaveRequest = new global::ChatServer.Transmissions.ChatLeaveRequest();
                }
                ChatLeaveRequest.MergeFrom(other.ChatLeaveRequest);
                break;

            case RequestOneofCase.NameChangeRequest:
                if (NameChangeRequest == null)
                {
                    NameChangeRequest = new global::ChatServer.Transmissions.NameChangeRequest();
                }
                NameChangeRequest.MergeFrom(other.NameChangeRequest);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }