Beispiel #1
0
        public void MergeFrom(pb::CodedInputStream input)
        {
    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
            input.ReadRawMessage(this);
    #else
            uint tag;
            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                    break;

                case 10: {
                    global::Prisel.Protobuf.ChatPayload subBuilder = new global::Prisel.Protobuf.ChatPayload();
                    if (payloadCase_ == PayloadOneofCase.ChatPayload)
                    {
                        subBuilder.MergeFrom(ChatPayload);
                    }
                    input.ReadMessage(subBuilder);
                    ChatPayload = subBuilder;
                    break;
                }

                case 18: {
                    global::Prisel.Protobuf.BroadcastPayload subBuilder = new global::Prisel.Protobuf.BroadcastPayload();
                    if (payloadCase_ == PayloadOneofCase.BroadcastPayload)
                    {
                        subBuilder.MergeFrom(BroadcastPayload);
                    }
                    input.ReadMessage(subBuilder);
                    BroadcastPayload = subBuilder;
                    break;
                }

                case 26: {
                    global::Prisel.Protobuf.CreateRoomRequest subBuilder = new global::Prisel.Protobuf.CreateRoomRequest();
                    if (payloadCase_ == PayloadOneofCase.CreateRoomRequest)
                    {
                        subBuilder.MergeFrom(CreateRoomRequest);
                    }
                    input.ReadMessage(subBuilder);
                    CreateRoomRequest = subBuilder;
                    break;
                }

                case 34: {
                    global::Prisel.Protobuf.CreateRoomResponse subBuilder = new global::Prisel.Protobuf.CreateRoomResponse();
                    if (payloadCase_ == PayloadOneofCase.CreateRoomResponse)
                    {
                        subBuilder.MergeFrom(CreateRoomResponse);
                    }
                    input.ReadMessage(subBuilder);
                    CreateRoomResponse = subBuilder;
                    break;
                }

                case 42: {
                    global::Prisel.Protobuf.ErrorPayload subBuilder = new global::Prisel.Protobuf.ErrorPayload();
                    if (payloadCase_ == PayloadOneofCase.ErrorPayload)
                    {
                        subBuilder.MergeFrom(ErrorPayload);
                    }
                    input.ReadMessage(subBuilder);
                    ErrorPayload = subBuilder;
                    break;
                }

                case 50: {
                    global::Prisel.Protobuf.GetLobbyStateResponse subBuilder = new global::Prisel.Protobuf.GetLobbyStateResponse();
                    if (payloadCase_ == PayloadOneofCase.GetLobbyStateResponse)
                    {
                        subBuilder.MergeFrom(GetLobbyStateResponse);
                    }
                    input.ReadMessage(subBuilder);
                    GetLobbyStateResponse = subBuilder;
                    break;
                }

                case 58: {
                    global::Prisel.Protobuf.GetRoomStateResponse subBuilder = new global::Prisel.Protobuf.GetRoomStateResponse();
                    if (payloadCase_ == PayloadOneofCase.GetRoomStateResponse)
                    {
                        subBuilder.MergeFrom(GetRoomStateResponse);
                    }
                    input.ReadMessage(subBuilder);
                    GetRoomStateResponse = subBuilder;
                    break;
                }

                case 66: {
                    global::Prisel.Protobuf.JoinRequest subBuilder = new global::Prisel.Protobuf.JoinRequest();
                    if (payloadCase_ == PayloadOneofCase.JoinRequest)
                    {
                        subBuilder.MergeFrom(JoinRequest);
                    }
                    input.ReadMessage(subBuilder);
                    JoinRequest = subBuilder;
                    break;
                }

                case 74: {
                    global::Prisel.Protobuf.JoinResponse subBuilder = new global::Prisel.Protobuf.JoinResponse();
                    if (payloadCase_ == PayloadOneofCase.JoinResponse)
                    {
                        subBuilder.MergeFrom(JoinResponse);
                    }
                    input.ReadMessage(subBuilder);
                    JoinResponse = subBuilder;
                    break;
                }

                case 82: {
                    global::Prisel.Protobuf.LoginRequest subBuilder = new global::Prisel.Protobuf.LoginRequest();
                    if (payloadCase_ == PayloadOneofCase.LoginRequest)
                    {
                        subBuilder.MergeFrom(LoginRequest);
                    }
                    input.ReadMessage(subBuilder);
                    LoginRequest = subBuilder;
                    break;
                }

                case 90: {
                    global::Prisel.Protobuf.LoginResponse subBuilder = new global::Prisel.Protobuf.LoginResponse();
                    if (payloadCase_ == PayloadOneofCase.LoginResponse)
                    {
                        subBuilder.MergeFrom(LoginResponse);
                    }
                    input.ReadMessage(subBuilder);
                    LoginResponse = subBuilder;
                    break;
                }

                case 98: {
                    global::Prisel.Protobuf.RoomStateChangePayload subBuilder = new global::Prisel.Protobuf.RoomStateChangePayload();
                    if (payloadCase_ == PayloadOneofCase.RoomStateChangePayload)
                    {
                        subBuilder.MergeFrom(RoomStateChangePayload);
                    }
                    input.ReadMessage(subBuilder);
                    RoomStateChangePayload = subBuilder;
                    break;
                }

                case 122: {
                    global::Google.Protobuf.WellKnownTypes.Any subBuilder = new global::Google.Protobuf.WellKnownTypes.Any();
                    if (payloadCase_ == PayloadOneofCase.ActionPayload)
                    {
                        subBuilder.MergeFrom(ActionPayload);
                    }
                    input.ReadMessage(subBuilder);
                    ActionPayload = subBuilder;
                    break;
                }
                }
            }
    #endif
        }
Beispiel #2
0
        void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
                    break;

                case 10: {
                    global::Prisel.Protobuf.ChatPayload subBuilder = new global::Prisel.Protobuf.ChatPayload();
                    if (payloadCase_ == PayloadOneofCase.ChatPayload)
                    {
                        subBuilder.MergeFrom(ChatPayload);
                    }
                    input.ReadMessage(subBuilder);
                    ChatPayload = subBuilder;
                    break;
                }

                case 18: {
                    global::Prisel.Protobuf.BroadcastPayload subBuilder = new global::Prisel.Protobuf.BroadcastPayload();
                    if (payloadCase_ == PayloadOneofCase.BroadcastPayload)
                    {
                        subBuilder.MergeFrom(BroadcastPayload);
                    }
                    input.ReadMessage(subBuilder);
                    BroadcastPayload = subBuilder;
                    break;
                }

                case 26: {
                    global::Prisel.Protobuf.CreateRoomRequest subBuilder = new global::Prisel.Protobuf.CreateRoomRequest();
                    if (payloadCase_ == PayloadOneofCase.CreateRoomRequest)
                    {
                        subBuilder.MergeFrom(CreateRoomRequest);
                    }
                    input.ReadMessage(subBuilder);
                    CreateRoomRequest = subBuilder;
                    break;
                }

                case 34: {
                    global::Prisel.Protobuf.CreateRoomResponse subBuilder = new global::Prisel.Protobuf.CreateRoomResponse();
                    if (payloadCase_ == PayloadOneofCase.CreateRoomResponse)
                    {
                        subBuilder.MergeFrom(CreateRoomResponse);
                    }
                    input.ReadMessage(subBuilder);
                    CreateRoomResponse = subBuilder;
                    break;
                }

                case 42: {
                    global::Prisel.Protobuf.ErrorPayload subBuilder = new global::Prisel.Protobuf.ErrorPayload();
                    if (payloadCase_ == PayloadOneofCase.ErrorPayload)
                    {
                        subBuilder.MergeFrom(ErrorPayload);
                    }
                    input.ReadMessage(subBuilder);
                    ErrorPayload = subBuilder;
                    break;
                }

                case 50: {
                    global::Prisel.Protobuf.GetLobbyStateResponse subBuilder = new global::Prisel.Protobuf.GetLobbyStateResponse();
                    if (payloadCase_ == PayloadOneofCase.GetLobbyStateResponse)
                    {
                        subBuilder.MergeFrom(GetLobbyStateResponse);
                    }
                    input.ReadMessage(subBuilder);
                    GetLobbyStateResponse = subBuilder;
                    break;
                }

                case 58: {
                    global::Prisel.Protobuf.GetRoomStateResponse subBuilder = new global::Prisel.Protobuf.GetRoomStateResponse();
                    if (payloadCase_ == PayloadOneofCase.GetRoomStateResponse)
                    {
                        subBuilder.MergeFrom(GetRoomStateResponse);
                    }
                    input.ReadMessage(subBuilder);
                    GetRoomStateResponse = subBuilder;
                    break;
                }

                case 66: {
                    global::Prisel.Protobuf.JoinRequest subBuilder = new global::Prisel.Protobuf.JoinRequest();
                    if (payloadCase_ == PayloadOneofCase.JoinRequest)
                    {
                        subBuilder.MergeFrom(JoinRequest);
                    }
                    input.ReadMessage(subBuilder);
                    JoinRequest = subBuilder;
                    break;
                }

                case 74: {
                    global::Prisel.Protobuf.JoinResponse subBuilder = new global::Prisel.Protobuf.JoinResponse();
                    if (payloadCase_ == PayloadOneofCase.JoinResponse)
                    {
                        subBuilder.MergeFrom(JoinResponse);
                    }
                    input.ReadMessage(subBuilder);
                    JoinResponse = subBuilder;
                    break;
                }

                case 82: {
                    global::Prisel.Protobuf.LoginRequest subBuilder = new global::Prisel.Protobuf.LoginRequest();
                    if (payloadCase_ == PayloadOneofCase.LoginRequest)
                    {
                        subBuilder.MergeFrom(LoginRequest);
                    }
                    input.ReadMessage(subBuilder);
                    LoginRequest = subBuilder;
                    break;
                }

                case 90: {
                    global::Prisel.Protobuf.LoginResponse subBuilder = new global::Prisel.Protobuf.LoginResponse();
                    if (payloadCase_ == PayloadOneofCase.LoginResponse)
                    {
                        subBuilder.MergeFrom(LoginResponse);
                    }
                    input.ReadMessage(subBuilder);
                    LoginResponse = subBuilder;
                    break;
                }

                case 98: {
                    global::Prisel.Protobuf.RoomStateChangePayload subBuilder = new global::Prisel.Protobuf.RoomStateChangePayload();
                    if (payloadCase_ == PayloadOneofCase.RoomStateChangePayload)
                    {
                        subBuilder.MergeFrom(RoomStateChangePayload);
                    }
                    input.ReadMessage(subBuilder);
                    RoomStateChangePayload = subBuilder;
                    break;
                }

                case 122: {
                    global::Google.Protobuf.WellKnownTypes.Any subBuilder = new global::Google.Protobuf.WellKnownTypes.Any();
                    if (payloadCase_ == PayloadOneofCase.ActionPayload)
                    {
                        subBuilder.MergeFrom(ActionPayload);
                    }
                    input.ReadMessage(subBuilder);
                    ActionPayload = subBuilder;
                    break;
                }
                }
            }
        }
Beispiel #3
0
        public void MergeFrom(Payload other)
        {
            if (other == null)
            {
                return;
            }
            switch (other.PayloadCase)
            {
            case PayloadOneofCase.ChatPayload:
                if (ChatPayload == null)
                {
                    ChatPayload = new global::Prisel.Protobuf.ChatPayload();
                }
                ChatPayload.MergeFrom(other.ChatPayload);
                break;

            case PayloadOneofCase.BroadcastPayload:
                if (BroadcastPayload == null)
                {
                    BroadcastPayload = new global::Prisel.Protobuf.BroadcastPayload();
                }
                BroadcastPayload.MergeFrom(other.BroadcastPayload);
                break;

            case PayloadOneofCase.CreateRoomRequest:
                if (CreateRoomRequest == null)
                {
                    CreateRoomRequest = new global::Prisel.Protobuf.CreateRoomRequest();
                }
                CreateRoomRequest.MergeFrom(other.CreateRoomRequest);
                break;

            case PayloadOneofCase.CreateRoomResponse:
                if (CreateRoomResponse == null)
                {
                    CreateRoomResponse = new global::Prisel.Protobuf.CreateRoomResponse();
                }
                CreateRoomResponse.MergeFrom(other.CreateRoomResponse);
                break;

            case PayloadOneofCase.ErrorPayload:
                if (ErrorPayload == null)
                {
                    ErrorPayload = new global::Prisel.Protobuf.ErrorPayload();
                }
                ErrorPayload.MergeFrom(other.ErrorPayload);
                break;

            case PayloadOneofCase.GetLobbyStateResponse:
                if (GetLobbyStateResponse == null)
                {
                    GetLobbyStateResponse = new global::Prisel.Protobuf.GetLobbyStateResponse();
                }
                GetLobbyStateResponse.MergeFrom(other.GetLobbyStateResponse);
                break;

            case PayloadOneofCase.GetRoomStateResponse:
                if (GetRoomStateResponse == null)
                {
                    GetRoomStateResponse = new global::Prisel.Protobuf.GetRoomStateResponse();
                }
                GetRoomStateResponse.MergeFrom(other.GetRoomStateResponse);
                break;

            case PayloadOneofCase.JoinRequest:
                if (JoinRequest == null)
                {
                    JoinRequest = new global::Prisel.Protobuf.JoinRequest();
                }
                JoinRequest.MergeFrom(other.JoinRequest);
                break;

            case PayloadOneofCase.JoinResponse:
                if (JoinResponse == null)
                {
                    JoinResponse = new global::Prisel.Protobuf.JoinResponse();
                }
                JoinResponse.MergeFrom(other.JoinResponse);
                break;

            case PayloadOneofCase.LoginRequest:
                if (LoginRequest == null)
                {
                    LoginRequest = new global::Prisel.Protobuf.LoginRequest();
                }
                LoginRequest.MergeFrom(other.LoginRequest);
                break;

            case PayloadOneofCase.LoginResponse:
                if (LoginResponse == null)
                {
                    LoginResponse = new global::Prisel.Protobuf.LoginResponse();
                }
                LoginResponse.MergeFrom(other.LoginResponse);
                break;

            case PayloadOneofCase.RoomStateChangePayload:
                if (RoomStateChangePayload == null)
                {
                    RoomStateChangePayload = new global::Prisel.Protobuf.RoomStateChangePayload();
                }
                RoomStateChangePayload.MergeFrom(other.RoomStateChangePayload);
                break;

            case PayloadOneofCase.ActionPayload:
                if (ActionPayload == null)
                {
                    ActionPayload = new global::Google.Protobuf.WellKnownTypes.Any();
                }
                ActionPayload.MergeFrom(other.ActionPayload);
                break;
            }

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