コード例 #1
0
        public int Serialize(ref byte[] targetBytes, int offset)
        {
            if (__extraFixedBytes != null || __tracker.IsDirty)
            {
                var startOffset = offset;
                offset += (8 + 4 * (3 + 1));

                offset += ObjectSegmentHelper.SerializeSegment <TTypeResolver, global::System.Collections.Generic.IList <float[]> >(ref targetBytes, startOffset, offset, 0, _vertices);
                offset += ObjectSegmentHelper.SerializeSegment <TTypeResolver, global::System.Collections.Generic.IList <float[]> >(ref targetBytes, startOffset, offset, 1, _uvs);
                offset += ObjectSegmentHelper.SerializeSegment <TTypeResolver, global::System.Collections.Generic.IList <float[]> >(ref targetBytes, startOffset, offset, 2, _normals);
                offset += ObjectSegmentHelper.SerializeSegment <TTypeResolver, global::System.Collections.Generic.IList <int[]> >(ref targetBytes, startOffset, offset, 3, _faces);

                return(ObjectSegmentHelper.WriteSize(ref targetBytes, startOffset, offset, 3));
            }
            else
            {
                return(ObjectSegmentHelper.DirectCopyAll(__originalBytes, ref targetBytes, offset));
            }
        }
コード例 #2
0
        public int Serialize(ref byte[] targetBytes, int offset)
        {
            if (__extraFixedBytes != null || __tracker.IsDirty)
            {
                var startOffset = offset;
                offset += (8 + 4 * (6 + 1));

                offset += ObjectSegmentHelper.SerializeFixedLength <TTypeResolver, int>(ref targetBytes, startOffset, offset, 0, __binaryLastIndex, __originalBytes, __extraFixedBytes, __tracker);
                offset += ObjectSegmentHelper.SerializeFixedLength <TTypeResolver, int>(ref targetBytes, startOffset, offset, 1, __binaryLastIndex, __originalBytes, __extraFixedBytes, __tracker);
                offset += ObjectSegmentHelper.SerializeCacheSegment <TTypeResolver, string>(ref targetBytes, startOffset, offset, 2, _z);
                offset += ObjectSegmentHelper.SerializeFixedLength <TTypeResolver, global::SharedLibrary.MyEnum>(ref targetBytes, startOffset, offset, 3, __binaryLastIndex, __originalBytes, __extraFixedBytes, __tracker);
                offset += ObjectSegmentHelper.SerializeCacheSegment <TTypeResolver, global::SharedLibrary.MyStructResponse>(ref targetBytes, startOffset, offset, 4, _soho);
                offset += ObjectSegmentHelper.SerializeFixedLength <TTypeResolver, ulong>(ref targetBytes, startOffset, offset, 5, __binaryLastIndex, __originalBytes, __extraFixedBytes, __tracker);
                offset += ObjectSegmentHelper.SerializeSegment <TTypeResolver, global::SharedLibrary.MyRequest>(ref targetBytes, startOffset, offset, 6, _req);

                return(ObjectSegmentHelper.WriteSize(ref targetBytes, startOffset, offset, 6));
            }
            else
            {
                return(ObjectSegmentHelper.DirectCopyAll(__originalBytes, ref targetBytes, offset));
            }
        }
コード例 #3
0
        public int Serialize(ref byte[] targetBytes, int offset)
        {
            if (__tracker.IsDirty)
            {
                var lastIndex   = 4; // schemaLastIndex
                var startOffset = offset;
                offset += (8 + 4 * (lastIndex + 1));

                // Auto Generate Area(incr index...)
                offset += ObjectSegmentHelper.SerializeFixedLength <int>(ref targetBytes, startOffset, offset, 0, __binaryLastIndex, __originalBytes, __extraFixedBytes, __tracker);
                offset += ObjectSegmentHelper.SerializeCacheSegment <string>(ref targetBytes, startOffset, offset, 1, _firstName);
                offset += ObjectSegmentHelper.SerializeCacheSegment <string>(ref targetBytes, startOffset, offset, 2, _lastName);
                offset += ObjectSegmentHelper.SerializeFixedLength <int>(ref targetBytes, startOffset, offset, 3, __binaryLastIndex, __originalBytes, __extraFixedBytes, __tracker);
                offset += ObjectSegmentHelper.SerializeSegment <IList <int> >(ref targetBytes, startOffset, offset, 4, _myList);

                return(ObjectSegmentHelper.WriteSize(ref targetBytes, startOffset, offset, lastIndex));
            }
            else
            {
                return(ObjectSegmentHelper.DirectCopyAll(__originalBytes, ref targetBytes, offset));
            }
        }