当前位置: 首页>>代码示例>>C#>>正文


C# IUnrealStream.WriteString方法代码示例

本文整理汇总了C#中IUnrealStream.WriteString方法的典型用法代码示例。如果您正苦于以下问题:C# IUnrealStream.WriteString方法的具体用法?C# IUnrealStream.WriteString怎么用?C# IUnrealStream.WriteString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IUnrealStream的用法示例。


在下文中一共展示了IUnrealStream.WriteString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Serialize

        public void Serialize( IUnrealStream stream )
        {
            stream.WriteString( Name );

            if( stream.Version < QWORDVersion )
            {
                // Writing UINT
                stream.UW.Write( (uint)Flags );
            }
            else
            {
                // Writing ULONG
                stream.UW.Write( Flags );
            }
        }
开发者ID:jjbott,项目名称:Unreal-Library,代码行数:15,代码来源:UNameTableItem.cs

示例2: Serialize

        public void Serialize( IUnrealStream stream )
        {
            // Serialize tables
            var namesBuffer = new UObjectStream( stream );
            foreach( var name in Names )
            {
                name.Serialize( namesBuffer );
            }

            var importsBuffer = new UObjectStream( stream );
            foreach( var import in Imports )
            {
                import.Serialize( importsBuffer );
            }

            var exportsBuffer = new UObjectStream( stream );
            foreach( var export in Exports )
            {
                //export.Serialize( exportsBuffer );
            }

            stream.Seek( 0, SeekOrigin.Begin );

            stream.Write( Signature );

            // Serialize header
            var version = (int)(Version & 0x0000FFFFU) | (LicenseeVersion << 16);
            stream.Write( version );

            var headerSizePosition = stream.Position;
            if( Version >= VHeaderSize )
            {
                stream.Write( (int)HeaderSize );
                if( Version >= VGroup )
                {
                    stream.WriteString( Group );
                }
            }

            stream.Write( PackageFlags );

            _TablesData.NamesCount = (uint)Names.Count;
            _TablesData.ExportsCount = (uint)Exports.Count;
            _TablesData.ImportsCount = (uint)Imports.Count;

            var tablesDataPosition = stream.Position;
            _TablesData.Serialize( stream );

            // TODO: Serialize Heritages

            stream.Write( Guid.NewGuid().ToByteArray(), 0, 16 );
            Generations.Serialize( stream );

            if( Version >= VEngineVersion )
            {
                stream.Write( EngineVersion );
                if( Version >= VCOOKEDPACKAGES )
                {
                    stream.Write( CookerVersion );

                    if( Version >= VCompression )
                    {
                        if( IsCooked() )
                        {
                            stream.Write( CompressionFlags );
                            CompressedChunks.Serialize( stream );
                        }
                    }
                }
            }

            // TODO: Unknown data
            stream.Write( (uint)0 );

            // Serialize objects

            // Write tables

            // names
            Console.WriteLine( "Writing names at position " + stream.Position );
            _TablesData.NamesOffset = (uint)stream.Position;
            var namesBytes = namesBuffer.GetBuffer();
            stream.Write( namesBytes, 0, (int)namesBuffer.Length );

            // imports
            Console.WriteLine( "Writing imports at position " + stream.Position );
            _TablesData.ImportsOffset = (uint)stream.Position;
            var importsBytes = importsBuffer.GetBuffer();
            stream.Write( importsBytes, 0, (int)importsBuffer.Length );

            // exports
            Console.WriteLine( "Writing exports at position " + stream.Position );

            // Serialize tables data again now that offsets are known.
            var currentPosition = stream.Position;
            stream.Seek( tablesDataPosition, SeekOrigin.Begin );
            _TablesData.Serialize( stream );
            stream.Seek( currentPosition, SeekOrigin.Begin );
        }
开发者ID:jjbott,项目名称:Unreal-Library,代码行数:99,代码来源:UnrealPackage.cs


注:本文中的IUnrealStream.WriteString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。