本文整理汇总了C#中StreamHandler.WriteStruct方法的典型用法代码示例。如果您正苦于以下问题:C# StreamHandler.WriteStruct方法的具体用法?C# StreamHandler.WriteStruct怎么用?C# StreamHandler.WriteStruct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StreamHandler
的用法示例。
在下文中一共展示了StreamHandler.WriteStruct方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
public void Write(StreamHandler Writer)
{
Writer.WriteUInt32((uint)Flags);
if ((Flags & (
SpellCastTargetFlags.Unit | SpellCastTargetFlags.Unk2 |
SpellCastTargetFlags.Object |
SpellCastTargetFlags.Corpse | SpellCastTargetFlags.PvPCorpse
)) != 0)
Writer.WritePackedGuid(TargetUnit);
if ((Flags & (SpellCastTargetFlags.Item | SpellCastTargetFlags.TradeItem)) != 0)
Writer.WritePackedGuid(TargetItem);
if ((Flags & SpellCastTargetFlags.SourceLocation) != 0)
{
Writer.WritePackedGuid(SourceTransportGuid);
Writer.WriteStruct<Vector3>(SourceLocation);
}
if ((Flags & SpellCastTargetFlags.DestLocation) != 0)
{
Writer.WritePackedGuid(DestTransportGuid);
Writer.WriteStruct<Vector3>(DestLocation);
}
if ((Flags & SpellCastTargetFlags.String) != 0)
Writer.WriteCString(StringTarget);
}
示例2: Save
public override void Save(StreamHandler writer)
{
writer.WriteInt32(Items.Length);
foreach (var item in Items)
writer.WriteStruct(item);
writer.WriteUInt32(TotalItemCount);
writer.WriteUInt32(NextSearchDelayMs);
}
示例3: Save
/// <summary>
/// Saves the current instance of SpellGo class to a StreamHandler.
/// </summary>
/// <param name="Writer">The StreamHandler to use.</param>
public override void Save(StreamHandler Writer)
{
Writer.WritePackedGuid(Caster);
Writer.WritePackedGuid(CastInvoker);
Writer.WriteByte(CastId);
Writer.WriteUInt32(SpellId);
Writer.WriteUInt32((uint)Flags);
Writer.WriteUInt32(Unk43);
Writer.WriteUInt32(CastTime);
Writer.WriteByte((byte)Hits.Count);
foreach (WowGuid guid in Hits)
Writer.WriteGuid(guid);
Writer.WriteByte((byte)Misses.Count);
foreach (MissData miss in Misses)
miss.Write(Writer);
TargetData.Write(Writer);
if ((Flags & CastFlags.PredictedPower) != 0)
Writer.WriteUInt32(PredictedPower);
if ((Flags & CastFlags.RuneStates) != 0)
{
Writer.WriteByte((byte)RunesBefore);
Writer.WriteByte((byte)RunesAfter);
for (int i = 0; i < RuneCooldowns.Length; ++i)
Writer.WriteByte((byte)RuneCooldowns[i]);
}
if ((Flags & CastFlags.Unk0x00020000) != 0)
{
Writer.WriteSingle(Unk0x20000_Float);
Writer.WriteUInt32(Unk0x20000_UInt32);
}
if ((Flags & CastFlags.Ammo) != 0)
{
Writer.WriteUInt32(ProjectileDisplayId);
Writer.WriteUInt32((uint)ProjectileInventoryType);
}
if ((Flags & CastFlags.Unk0x00080000) != 0)
{
Writer.WriteUInt32(Unk0x80000_UInt32_1);
Writer.WriteUInt32(Unk0x80000_UInt32_2);
}
if ((TargetData.Flags & SpellCastTargetFlags.DestLocation) != 0)
{
Writer.WriteByte(DestLocationCounter);
}
if ((TargetData.Flags & SpellCastTargetFlags.Unk4) != 0)
{
Writer.WriteUInt32(Unk4_Count);
foreach (var pair in Unk4_List)
{
Writer.WriteStruct(pair.Value);
Writer.WriteGuid(pair.Key);
if (pair.Key.IsEmpty)
break;
}
}
}