Пример #1
0
        public void MergeFrom(ClientPlayer other)
        {
            if (other == null)
            {
                return;
            }
            if (other.CreationTimeMs != 0L)
            {
                CreationTimeMs = other.CreationTimeMs;
            }
            switch (other.StateCase)
            {
            case StateOneofCase.Map:
                if (Map == null)
                {
                    Map = new global::WUProtos.Data.Client.ClientPlayerMapState();
                }
                Map.MergeFrom(other.Map);
                break;

            case StateOneofCase.Challenge:
                if (Challenge == null)
                {
                    Challenge = new global::WUProtos.Data.Client.ClientPlayerChallengeState();
                }
                Challenge.MergeFrom(other.Challenge);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
Пример #2
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

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

                case 8: {
                    CreationTimeMs = input.ReadInt64();
                    break;
                }

                case 18: {
                    global::WUProtos.Data.Client.ClientPlayerMapState subBuilder = new global::WUProtos.Data.Client.ClientPlayerMapState();
                    if (stateCase_ == StateOneofCase.Map)
                    {
                        subBuilder.MergeFrom(Map);
                    }
                    input.ReadMessage(subBuilder);
                    Map = subBuilder;
                    break;
                }

                case 26: {
                    global::WUProtos.Data.Client.ClientPlayerChallengeState subBuilder = new global::WUProtos.Data.Client.ClientPlayerChallengeState();
                    if (stateCase_ == StateOneofCase.Challenge)
                    {
                        subBuilder.MergeFrom(Challenge);
                    }
                    input.ReadMessage(subBuilder);
                    Challenge = subBuilder;
                    break;
                }
                }
            }
        }