本文整理匯總了C#中System.IO.BinaryWriter.WriteVariableLengthString方法的典型用法代碼示例。如果您正苦於以下問題:C# BinaryWriter.WriteVariableLengthString方法的具體用法?C# BinaryWriter.WriteVariableLengthString怎麽用?C# BinaryWriter.WriteVariableLengthString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.IO.BinaryWriter
的用法示例。
在下文中一共展示了BinaryWriter.WriteVariableLengthString方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: WriteMapWorld
private static void WriteMapWorld(BinaryWriter bw, World w)
{
bw.WriteVariableLengthString("CMapWorld");
WriteMapBase(bw, w);
WriteEntityData(bw, w.EntityData);
bw.Write(w.Paths.Count);
foreach (var path in w.Paths)
{
WritePath(bw, path);
}
}
示例2: WriteMapSolid
private static void WriteMapSolid(BinaryWriter bw, Solid s)
{
bw.WriteVariableLengthString("CMapSolid");
WriteMapBase(bw, s);
bw.Write(s.Faces.Count);
foreach (var face in s.Faces)
{
WriteFace(bw, face);
}
}
示例3: WriteMapGroup
private static void WriteMapGroup(BinaryWriter bw, Group g)
{
bw.WriteVariableLengthString("CMapGroup");
WriteMapBase(bw, g);
}
示例4: WriteMapEntity
private static void WriteMapEntity(BinaryWriter bw, Entity ent)
{
bw.WriteVariableLengthString("CMapEntity");
WriteMapBase(bw, ent);
WriteEntityData(bw, ent.EntityData);
bw.Write(new byte[2]); // Unused
bw.WriteCoordinate(ent.Origin);
bw.Write(new byte[4]); // Unused
}
示例5: WriteEntityData
private static void WriteEntityData(BinaryWriter bw, EntityData data)
{
bw.WriteVariableLengthString(data.Name);
bw.Write(new byte[4]); // Unused
bw.Write(data.Flags);
bw.Write(data.Properties.Count);
foreach (var property in data.Properties)
{
WriteProperty(bw, property);
}
bw.Write(new byte[12]); // Unused
}
示例6: WriteProperty
public static void WriteProperty(BinaryWriter bw, Property p)
{
bw.WriteVariableLengthString(p.Key);
bw.WriteVariableLengthString(p.Value);
}