本文整理汇总了C#中StreamHandler.WritePackedGuid方法的典型用法代码示例。如果您正苦于以下问题:C# StreamHandler.WritePackedGuid方法的具体用法?C# StreamHandler.WritePackedGuid怎么用?C# StreamHandler.WritePackedGuid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StreamHandler
的用法示例。
在下文中一共展示了StreamHandler.WritePackedGuid方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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.WritePackedGuid(this.Unit);
writer.WriteInt32(ThreatList.Length);
for (int i = 0; i < ThreatList.Length; ++i)
{
writer.WritePackedGuid(ThreatList[i].Unit);
writer.WriteUInt32(ThreatList[i].Threat);
}
}
示例3: Save
public override void Save(StreamHandler writer)
{
writer.WritePackedGuid(this.Unit);
foreach (var update in this.Auras)
update.Save(writer);
}
示例4: Save
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(Unk43_2);
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.Ammo) != 0)
{
Writer.WriteUInt32(ProjectileDisplayId);
Writer.WriteUInt32((uint)ProjectileInventoryType);
}
if ((Flags & CastFlags.Unk0x04000000) != 0)
{
Writer.WriteUInt32(Unk0x04000000_UInt32_1);
Writer.WriteUInt32(Unk0x04000000_UInt32_2);
}
}
示例5: Save
public override void Save(StreamHandler Writer)
{
Writer.WriteUInt16((ushort)this.Map);
EnsureRead();
long nUpdatesPos = Writer.BaseStream.Position;
uint nUpdates = 0;
Writer.WriteUInt32(nUpdates);
if (this.DestroyedObjects.Count > 0)
{
++nUpdates;
Writer.WriteByte((byte)UpdateTypes.DestroyObjects);
Writer.WriteInt32(this.DestroyedObjects.Count);
foreach (WowGuid guid in this.DestroyedObjects)
Writer.WritePackedGuid(guid);
}
foreach (var pair in this.ValuesUpdates)
{
++nUpdates;
Writer.WriteByte((byte)UpdateTypes.UpdateValues);
Writer.WritePackedGuid(pair.Key);
WriteValues(Writer, pair.Value, WowObject.GetTypeId(pair.Key.Type));
}
foreach (var pair in this.CreatedObjects)
{
++nUpdates;
var type = UpdateTypes.CreateObjects;
var obj = pair.Value;
if (obj.MovementData.HavePosition)
{
if (obj.TypeId == ObjectTypeId.DynamicObject
|| obj.TypeId == ObjectTypeId.Corpse
|| obj.TypeId == ObjectTypeId.Player)
{
type = UpdateTypes.CreateObjects2;
}
if (obj.TypeId == ObjectTypeId.GameObject && obj is WowGameObject)
{
switch ((obj as WowGameObject).GameObjectType)
{
case GameObjectTypes.Trap:
case GameObjectTypes.DuelArbiter:
case GameObjectTypes.FlagStand:
case GameObjectTypes.FlagDrop:
type = UpdateTypes.CreateObjects2;
break;
}
}
}
var guid = obj.Guid;
Writer.WriteByte((byte)type);
Writer.WritePackedGuid(guid);
Writer.WriteByte((byte)obj.TypeId);
obj.MovementData.Save(Writer);
WriteValues(Writer, obj.GetValues(), obj.TypeId);
}
long pos = Writer.BaseStream.Position;
Writer.BaseStream.Position = nUpdatesPos;
Writer.WriteUInt32(nUpdates);
Writer.BaseStream.Position = pos;
}
示例6: Save
public void Save(StreamHandler writer)
{
writer
.WriteByte(this.Slot)
.WriteUInt32(this.Spell);
if (this.Spell != 0)
{
writer
.WriteUInt16((ushort)this.Flags)
.WriteByte(this.Level)
.WriteByte(this.Charges);
if ((Flags & AuraFlags.NotCaster) == 0)
writer.WritePackedGuid(this.Caster);
if ((Flags & AuraFlags.Duration) != 0)
{
writer.WriteUInt32(this.MaxDuration);
writer.WriteUInt32(this.LeftDuration);
}
if ((Flags & AuraFlags.BasePoints) != 0)
{
for (int i = 0; i < MaxEffects; ++i)
{
if ((Flags & (AuraFlags)(1 << i)) != 0)
writer.WriteInt32(BasePoints[i]);
}
}
}
}