本文整理汇总了C#中VRage.Library.Collections.BitStream.ReadUInt64方法的典型用法代码示例。如果您正苦于以下问题:C# BitStream.ReadUInt64方法的具体用法?C# BitStream.ReadUInt64怎么用?C# BitStream.ReadUInt64使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VRage.Library.Collections.BitStream
的用法示例。
在下文中一共展示了BitStream.ReadUInt64方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteBitStream
public void WriteBitStream(BitStream readStream)
{
// Make better, preferably by reading to aligned area
int numBits = readStream.BitLength - readStream.m_bitPosition;
while (numBits > 0)
{
int readBits = Math.Min(64, numBits);
ulong value = readStream.ReadUInt64(readBits);
WriteUInt64(value, readBits);
numBits -= readBits;
}
}
示例2: Serialize
public void Serialize(BitStream stream, MyClientStateBase forClient, byte packetId, int maxBitPosition)
{
SmallBitField dirtyFlags;
if (stream.Writing)
{
var data = m_clientData[forClient];
dirtyFlags = data.DirtyProperties;
stream.WriteUInt64(dirtyFlags.Bits, m_properties.Count);
}
else
{
dirtyFlags.Bits = stream.ReadUInt64(m_properties.Count);
}
for (int i = 0; i < m_properties.Count; i++)
{
if (dirtyFlags[i])
{
m_properties[i].Serialize(stream, false); // Received from server, don't validate
if (stream.Reading) // Received from server, it's no longer dirty
m_dirtyProperties[i] = false;
}
}
if (stream.Writing && stream.BitPosition <= maxBitPosition)
{
var data = m_clientData[forClient];
data.PacketId = packetId;
data.SentProperties.Bits = data.DirtyProperties.Bits;
data.DirtyProperties.Bits = 0;
}
}