本文整理汇总了C#中IValueReader.ReadUInt16方法的典型用法代码示例。如果您正苦于以下问题:C# IValueReader.ReadUInt16方法的具体用法?C# IValueReader.ReadUInt16怎么用?C# IValueReader.ReadUInt16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IValueReader
的用法示例。
在下文中一共展示了IValueReader.ReadUInt16方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: Deserialize
public void Deserialize(ISerializationContext context, IValueReader reader)
{
ushort count = reader.ReadUInt16();
if (count == 0)
return;
lock (this.sync)
{
if (this.map == null)
{
this.map = new Dictionary<Type, ushort>();
this.reverseMap = new Dictionary<ushort, Type>();
this.newMappings = new Dictionary<Type, ushort>();
}
for (ushort i = 0; i < count; ++i)
{
Type t = Type.GetType (reader.ReadString());
this.map.Add (t, i);
this.reverseMap.Add (i, t);
}
}
}
示例3: ReadPayload
public override void ReadPayload(ISerializationContext context, IValueReader reader)
{
DeniedMessage = (GablarskiMessageType)reader.ReadUInt16();
}
示例4: ReadPayload
public override void ReadPayload(ISerializationContext context, IValueReader reader)
{
OriginalMessageId = reader.ReadUInt16();
Count = reader.ReadByte();
Payload = reader.ReadBytes();
}
示例5: ReadPayload
public override void ReadPayload(ISerializationContext context, IValueReader reader)
{
this.TargetType = (TargetType)reader.ReadByte();
ushort numTargets = reader.ReadUInt16();
int[] targets = new int[numTargets];
for (int i = 0; i < targets.Length; ++i)
targets[i] = reader.ReadInt32();
TargetIds = targets;
Sequence = reader.ReadInt32();
SourceId = reader.ReadInt32();
byte frames = reader.ReadByte();
Data = new byte[frames][];
for (int i = 0; i < frames; ++i)
Data[i] = reader.ReadBytes();
}