本文整理汇总了C#中IValueReader.ReadUInt方法的典型用法代码示例。如果您正苦于以下问题:C# IValueReader.ReadUInt方法的具体用法?C# IValueReader.ReadUInt怎么用?C# IValueReader.ReadUInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IValueReader
的用法示例。
在下文中一共展示了IValueReader.ReadUInt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deserialize
/// <summary>
/// Reads all of the changed property values from the specified IValueReader. Use in conjunction with Serialize().
/// </summary>
/// <param name="reader">IValueReader to read the changed property values from.</param>
public void Deserialize(IValueReader reader)
{
// Highest possible PropertySync index that we will be writing
uint highestPropertyIndex = _lastNetworkSyncIndex;
// Grab the count for the number of properties to read
var count = reader.ReadUInt("Count", 0, highestPropertyIndex);
// Read the properties, which will be in ascending order
// See the Serialize() function to see why this is, and why we do it this way
uint lastIndex = 0;
for (var i = 0; i < count; i++)
{
// Get the PropertySync to be deserialized
var propIndex = reader.ReadUInt(_propertyIndexValueKey, lastIndex, highestPropertyIndex);
var propertySync = _propertySyncs[propIndex];
// Read the value into the property
propertySync.ReadValue(this, reader);
// Allow for additional post-deserializtion processing
OnDeserializeProprety(reader, propertySync);
// Store this property index as the last written index
lastIndex = propIndex;
}
}