本文整理汇总了C#中WCell.Constants.Updates.UpdateFieldId类的典型用法代码示例。如果您正苦于以下问题:C# UpdateFieldId类的具体用法?C# UpdateFieldId怎么用?C# UpdateFieldId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UpdateFieldId类属于WCell.Constants.Updates命名空间,在下文中一共展示了UpdateFieldId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetByteArray
public byte[] GetByteArray(UpdateFieldId field)
{
return m_updateValues[field.RawId].ByteArray;
}
示例2: GetInt
public int GetInt(UpdateFieldId id)
{
return Values.GetInt32((uint)id.RawId);
}
示例3: GetByte
public byte GetByte(UpdateFieldId id)
{
var i = (uint)id.RawId * 4;
if (Values.Length < i + 1)
{
return 0;
}
return Values[i];
}
示例4: PushFieldUpdateToPlayer
public void PushFieldUpdateToPlayer(Character character, UpdateFieldId field, byte[] value)
{
using (var packet = GetFieldUpdatePacket(field, value))
{
SendUpdatePacket(character, packet);
}
}
示例5: GetULong
public ulong GetULong(UpdateFieldId id)
{
return Values.GetUInt64((uint)id.RawId);
}
示例6: PushFieldUpdate
public void PushFieldUpdate(UpdateFieldId field, EntityId value)
{
if (!IsInWorld)
{
// set the value and don't push, we aren't in game so we'll get it on the next self full update
SetEntityId(field, value);
return;
}
using (var packet = GetFieldUpdatePacket(field, value))
{
SendUpdatePacket(this, packet);
}
}
示例7: GetFieldUpdatePacket
protected UpdatePacket GetFieldUpdatePacket(UpdateFieldId field, byte[] value)
{
var blocks = (field.RawId >> 5) + 1;
var emptyBlockSize = (blocks - 1) * 4;
//UpdatePacket packet = new UpdatePacket(BufferManager.Small.CheckOut());
var packet = new UpdatePacket { Position = 4 };
packet.Write(1); // Update Count
packet.Write((byte)UpdateType.Values);
EntityId.WritePacked(packet);
packet.Write((byte)blocks);
//packet.TotalLength += emptyBlockSize;
packet.Zero(emptyBlockSize);
packet.Write(1 << (field.RawId & 31));
packet.Write(value);
return packet;
}
示例8: SetUInt32
public void SetUInt32(UpdateFieldId field, uint value)
{
SetUInt32(field.RawId, value);
}
示例9: SetUInt64
public void SetUInt64(UpdateFieldId field, ulong value)
{
SetUInt64(field.RawId, value);
}
示例10: SetUInt16High
public void SetUInt16High(UpdateFieldId field, ushort value)
{
SetUInt16High(field.RawId, value);
}
示例11: GetFloat
public float GetFloat(UpdateFieldId field)
{
return m_updateValues[field.RawId].Float;
}
示例12: SetInt16Low
public void SetInt16Low(UpdateFieldId field, short value)
{
SetInt16Low(field.RawId, value);
}
示例13: SetFloat
public void SetFloat(UpdateFieldId field, float value)
{
SetFloat(field.RawId, value);
}
示例14: GetByte
public byte GetByte(UpdateFieldId field, int index)
{
return m_updateValues[field.RawId].GetByte(index);
}
示例15: SendFieldUpdateToArea
/// <summary>
/// Sends a manual update field refresh to all nearby characters.
/// </summary>
/// <param name="field">the field to refresh</param>
public void SendFieldUpdateToArea(UpdateFieldId field)
{
if (IsAreaActive)
{
var value = GetUInt32(field.RawId);
using (var packet = GetFieldUpdatePacket(field, value))
{
SendPacketToArea(packet);
}
}
}