本文整理汇总了C#中IWriter.WriteUTF16方法的典型用法代码示例。如果您正苦于以下问题:C# IWriter.WriteUTF16方法的具体用法?C# IWriter.WriteUTF16怎么用?C# IWriter.WriteUTF16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWriter
的用法示例。
在下文中一共展示了IWriter.WriteUTF16方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WritePatchInfo
private static void WritePatchInfo(Patch patch, ContainerWriter container, IWriter writer)
{
container.StartBlock("titl", 2); // Version 2
// Write target map info
writer.WriteInt32(patch.MapID);
if (patch.MapInternalName != null)
writer.WriteAscii(patch.MapInternalName);
else
writer.WriteByte(0);
// Write patch info
writer.WriteUTF16(patch.Name);
writer.WriteUTF16(patch.Description);
writer.WriteUTF16(patch.Author);
// Write screenshot
if (patch.Screenshot != null)
{
writer.WriteInt32(patch.Screenshot.Length);
writer.WriteBlock(patch.Screenshot);
}
else
{
writer.WriteInt32(0);
}
// Write meta info
writer.WriteUInt32(patch.MetaPokeBase);
writer.WriteSByte((sbyte) patch.MetaChangesIndex);
// Write output name
if (patch.OutputName != null)
writer.WriteAscii(patch.OutputName);
else
writer.WriteByte(0);
container.EndBlock();
}
示例2: WritePatchInfo
private static void WritePatchInfo(Patch patch, IWriter writer)
{
long startPos = writer.Position;
writer.WriteInt32(AssemblyPatchBlockID.Titl);
writer.WriteUInt32(0); // Size filled in later
writer.WriteByte(0); // Version 0
writer.WriteInt32(patch.MapID);
if (patch.MapInternalName != null)
writer.WriteAscii(patch.MapInternalName);
else
writer.WriteByte(0);
writer.WriteUTF16(patch.Name);
writer.WriteUTF16(patch.Description);
writer.WriteUTF16(patch.Author);
if (patch.Screenshot != null)
{
writer.WriteInt32(patch.Screenshot.Length);
writer.WriteBlock(patch.Screenshot);
}
else
{
writer.WriteInt32(0);
}
// Fill in the block size
long endPos = writer.Position;
writer.SeekTo(startPos + 4);
writer.WriteUInt32((uint)(endPos - startPos));
writer.SeekTo(endPos);
}
示例3: WritePatchInfo
private static void WritePatchInfo(Patch patch, IWriter writer)
{
var startPos = WriteBlockHeader(writer, AssemblyPatchBlockID.Titl);
writer.WriteByte(1); // Version 1
// Write target map info
writer.WriteInt32(patch.MapID);
if (patch.MapInternalName != null)
writer.WriteAscii(patch.MapInternalName);
else
writer.WriteByte(0);
// Write patch info
writer.WriteUTF16(patch.Name);
writer.WriteUTF16(patch.Description);
writer.WriteUTF16(patch.Author);
// Write screenshot
if (patch.Screenshot != null)
{
writer.WriteInt32(patch.Screenshot.Length);
writer.WriteBlock(patch.Screenshot);
}
else
{
writer.WriteInt32(0);
}
// Write meta info
writer.WriteUInt32(patch.MetaPokeBase);
writer.WriteSByte((sbyte)patch.MetaChangesIndex);
EndBlock(writer, startPos);
}