本文整理汇总了C#中IUnrealStream.Write方法的典型用法代码示例。如果您正苦于以下问题:C# IUnrealStream.Write方法的具体用法?C# IUnrealStream.Write怎么用?C# IUnrealStream.Write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IUnrealStream
的用法示例。
在下文中一共展示了IUnrealStream.Write方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Serialize
public void Serialize( IUnrealStream stream )
{
Console.WriteLine( "Writing import " + ObjectName + " at " + stream.Position );
stream.Write( PackageName );
stream.Write( _ClassName );
stream.Write( OuterTable != null ? (int)OuterTable.Object : 0 ); // Always an ordinary integer
stream.Write( ObjectName );
}
示例2: Serialize
public void Serialize( IUnrealStream stream )
{
// TODO: Implement code
stream.Write( UncompressedOffset );
stream.Write( UncompressedSize );
stream.Write( CompressedOffset );
stream.Write( CompressedSize );
}
示例3: Serialize
public void Serialize( IUnrealStream stream )
{
stream.Write( ExportsCount );
stream.Write( NamesCount );
if( stream.Version >= VNetObjectsCount )
{
stream.Write( NetObjectsCount );
}
}
示例4: Serialize
public void Serialize( IUnrealStream stream )
{
stream.WriteIndex( _Index );
if( stream.Version >= VNameNumbered )
{
Console.WriteLine( _Number + " " + _Text );
stream.Write( (uint)_Number + 1 );
}
}
示例5: Serialize
//public Dictionary<int, int> Components;
//public List<int> NetObjects;
#endregion
// @Warning - Only supports Official builds.
public void Serialize( IUnrealStream stream )
{
stream.Write( ClassTable.Object );
stream.Write( SuperTable.Object );
stream.Write( (int)OuterTable.Object );
stream.Write( ObjectName );
if( stream.Version >= VArchetype )
{
ArchetypeIndex = stream.ReadInt32();
}
stream.UW.Write( stream.Version >= VObjectFlagsToULONG ? ObjectFlags : (uint)ObjectFlags );
stream.WriteIndex( SerialSize ); // Assumes SerialSize has been updated to @Object's buffer size.
if( SerialSize > 0 || stream.Version >= VSerialSizeConditionless )
{
// SerialOffset has to be set and written after this object has been serialized.
stream.WriteIndex( SerialOffset ); // Assumes the same as @SerialSize comment.
}
// TODO: Continue.
}
示例6: Serialize
public void Serialize( IUnrealStream stream )
{
stream.Write( NamesCount );
stream.Write( NamesOffset );
stream.Write( ExportsCount );
stream.Write( ExportsOffset );
stream.Write( ImportsCount );
stream.Write( ImportsOffset );
if( stream.Version < 415 )
return;
// DependsOffset
stream.Write( DependsOffset );
}
示例7: 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 );
}