本文整理汇总了C#中IValueReader.Read方法的典型用法代码示例。如果您正苦于以下问题:C# IValueReader.Read方法的具体用法?C# IValueReader.Read怎么用?C# IValueReader.Read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IValueReader
的用法示例。
在下文中一共展示了IValueReader.Read方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadEntity
private NetworkEntity ReadEntity(ISerializationContext context, IValueReader reader)
{
var entity = new NetworkEntity (reader.ReadString (), EntityType.Client);
entity.NetworkID = reader.ReadUInt16 ();
UInt16 fieldCount = reader.ReadUInt16 ();
for (int f = 0; f < fieldCount; f++)
{
string name = reader.ReadString ();
ushort typeID = reader.ReadUInt16 ();
Type type;
context.TypeMap.TryGetType (typeID, out type);
object value;
if (type == typeof (Vector2))
value = reader.Read (context, Vector2Serializer.Instance);
else if (type == typeof (Vector3))
value = reader.Read (context, Vector3Serializer.Instance);
else
value = reader.Read (context, type);
entity.Fields.Add (name, new PropertyGroup (value, type));
}
return entity;
}
示例2: ReadPayload
public override void ReadPayload (ISerializationContext context, IValueReader reader)
{
Inviter = reader.ReadString();
Group = reader.Read (context, GroupSerializer.Instance);
}
示例3: ReadPayload
public override void ReadPayload(ISerializationContext context, IValueReader reader)
{
SignatureHashAlgorithm = reader.ReadString();
Protocol[] protocols = new Protocol[reader.ReadInt32()];
for (int i = 0; i < protocols.Length; ++i)
protocols[i] = new Protocol (context, reader);
EnabledProtocols = protocols;
ConnectionId = reader.ReadInt64();
PublicEncryptionKey = reader.Read<IAsymmetricKey> (context);
PublicAuthenticationKey = reader.Read<IAsymmetricKey> (context);
}
示例4: ReadPayload
public override void ReadPayload (ISerializationContext context, IValueReader reader)
{
Person = reader.Read<Person> (context);
}
示例5: ReadPayload
public override void ReadPayload(ISerializationContext context, IValueReader reader)
{
Direction = reader.Read<Vector2> (context);
}
示例6: ReadPayload
public override void ReadPayload(ISerializationContext context, IValueReader reader)
{
Object = reader.Read (context);
}