Esempio n. 1
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 10: {
                    Topic = input.ReadString();
                    break;
                }

                case 17: {
                    Number = input.ReadDouble();
                    break;
                }

                case 24: {
                    Boolean = input.ReadBool();
                    break;
                }

                case 34: {
                    String = input.ReadString();
                    break;
                }

                case 42: {
                    global::Ubii.DataStructure.Vector2 subBuilder = new global::Ubii.DataStructure.Vector2();
                    if (typeCase_ == TypeOneofCase.Vector2)
                    {
                        subBuilder.MergeFrom(Vector2);
                    }
                    input.ReadMessage(subBuilder);
                    Vector2 = subBuilder;
                    break;
                }

                case 50: {
                    global::Ubii.DataStructure.Vector3 subBuilder = new global::Ubii.DataStructure.Vector3();
                    if (typeCase_ == TypeOneofCase.Vector3)
                    {
                        subBuilder.MergeFrom(Vector3);
                    }
                    input.ReadMessage(subBuilder);
                    Vector3 = subBuilder;
                    break;
                }

                case 58: {
                    global::Ubii.DataStructure.Vector4 subBuilder = new global::Ubii.DataStructure.Vector4();
                    if (typeCase_ == TypeOneofCase.Vector4)
                    {
                        subBuilder.MergeFrom(Vector4);
                    }
                    input.ReadMessage(subBuilder);
                    Vector4 = subBuilder;
                    break;
                }

                case 66: {
                    global::Ubii.DataStructure.Quaternion subBuilder = new global::Ubii.DataStructure.Quaternion();
                    if (typeCase_ == TypeOneofCase.Quaternion)
                    {
                        subBuilder.MergeFrom(Quaternion);
                    }
                    input.ReadMessage(subBuilder);
                    Quaternion = subBuilder;
                    break;
                }

                case 74: {
                    global::Ubii.DataStructure.Matrix3x2 subBuilder = new global::Ubii.DataStructure.Matrix3x2();
                    if (typeCase_ == TypeOneofCase.Matrix3X2)
                    {
                        subBuilder.MergeFrom(Matrix3X2);
                    }
                    input.ReadMessage(subBuilder);
                    Matrix3X2 = subBuilder;
                    break;
                }

                case 82: {
                    global::Ubii.DataStructure.Matrix4x4 subBuilder = new global::Ubii.DataStructure.Matrix4x4();
                    if (typeCase_ == TypeOneofCase.Matrix4X4)
                    {
                        subBuilder.MergeFrom(Matrix4X4);
                    }
                    input.ReadMessage(subBuilder);
                    Matrix4X4 = subBuilder;
                    break;
                }

                case 90: {
                    global::Ubii.DataStructure.Color subBuilder = new global::Ubii.DataStructure.Color();
                    if (typeCase_ == TypeOneofCase.Color)
                    {
                        subBuilder.MergeFrom(Color);
                    }
                    input.ReadMessage(subBuilder);
                    Color = subBuilder;
                    break;
                }
                }
            }
        }
Esempio n. 2
0
        public void MergeFrom(TopicDataRecord other)
        {
            if (other == null)
            {
                return;
            }
            if (other.Topic.Length != 0)
            {
                Topic = other.Topic;
            }
            switch (other.TypeCase)
            {
            case TypeOneofCase.Number:
                Number = other.Number;
                break;

            case TypeOneofCase.Boolean:
                Boolean = other.Boolean;
                break;

            case TypeOneofCase.String:
                String = other.String;
                break;

            case TypeOneofCase.Vector2:
                if (Vector2 == null)
                {
                    Vector2 = new global::Ubii.DataStructure.Vector2();
                }
                Vector2.MergeFrom(other.Vector2);
                break;

            case TypeOneofCase.Vector3:
                if (Vector3 == null)
                {
                    Vector3 = new global::Ubii.DataStructure.Vector3();
                }
                Vector3.MergeFrom(other.Vector3);
                break;

            case TypeOneofCase.Vector4:
                if (Vector4 == null)
                {
                    Vector4 = new global::Ubii.DataStructure.Vector4();
                }
                Vector4.MergeFrom(other.Vector4);
                break;

            case TypeOneofCase.Quaternion:
                if (Quaternion == null)
                {
                    Quaternion = new global::Ubii.DataStructure.Quaternion();
                }
                Quaternion.MergeFrom(other.Quaternion);
                break;

            case TypeOneofCase.Matrix3X2:
                if (Matrix3X2 == null)
                {
                    Matrix3X2 = new global::Ubii.DataStructure.Matrix3x2();
                }
                Matrix3X2.MergeFrom(other.Matrix3X2);
                break;

            case TypeOneofCase.Matrix4X4:
                if (Matrix4X4 == null)
                {
                    Matrix4X4 = new global::Ubii.DataStructure.Matrix4x4();
                }
                Matrix4X4.MergeFrom(other.Matrix4X4);
                break;

            case TypeOneofCase.Color:
                if (Color == null)
                {
                    Color = new global::Ubii.DataStructure.Color();
                }
                Color.MergeFrom(other.Color);
                break;
            }

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