本文整理汇总了C#中StreamHandler.WriteUInt16方法的典型用法代码示例。如果您正苦于以下问题:C# StreamHandler.WriteUInt16方法的具体用法?C# StreamHandler.WriteUInt16怎么用?C# StreamHandler.WriteUInt16使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StreamHandler
的用法示例。
在下文中一共展示了StreamHandler.WriteUInt16方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Save
public override void Save(StreamHandler writer)
{
writer.WriteUInt32((uint)Roles);
writer.WriteUInt16(0);
writer.WriteByte((byte)Dungeons.Length);
foreach (var entry in Dungeons)
writer.WriteUInt32(entry.Entry);
writer.WriteByte(3);
writer.WriteUInt16(0);
writer.WriteByte(0);
writer.WriteCString(Comment);
}
示例2: 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;
}
示例3: 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]);
}
}
}
}