本文整理汇总了C#中Lidgren.Network.NetIncomingMessage.ReadSingle方法的典型用法代码示例。如果您正苦于以下问题:C# NetIncomingMessage.ReadSingle方法的具体用法?C# NetIncomingMessage.ReadSingle怎么用?C# NetIncomingMessage.ReadSingle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lidgren.Network.NetIncomingMessage
的用法示例。
在下文中一共展示了NetIncomingMessage.ReadSingle方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Decode
public void Decode(NetIncomingMessage im)
{
Id = im.ReadInt64();
MessageTime = im.ReadDouble();
/*this.Position = im.ReadVector3();
this.Velocity = im.ReadVector3();*/
Rotation = im.ReadSingle();
}
示例2: Read
public static MsgPlayerServerUpdatePacket Read(NetIncomingMessage packet)
{
Byte slot = packet.ReadByte();
Vector2 position = new Vector2 { X = packet.ReadSingle(), Y = packet.ReadSingle() };
Single rotation = packet.ReadSingle();
return new MsgPlayerServerUpdatePacket(slot, position, rotation);
}
示例3: Read
public static MsgBeginShotPacket Read(NetIncomingMessage packet)
{
Byte slot = packet.ReadByte();
Byte shotSlot = packet.ReadByte();
Vector2 position = packet.ReadVector2();
Single rotation = packet.ReadSingle();
Vector2 velocity = packet.ReadVector2();
return new MsgBeginShotPacket(slot, shotSlot, position, rotation, velocity);
}
示例4: ReadValue
private static Object ReadValue(NetIncomingMessage packet, TypeCode typeCode)
{
Object value;
switch (typeCode)
{
case TypeCode.Empty:
throw new NotSupportedException("Empty is not a supported type for variables");
case TypeCode.Object:
throw new NotSupportedException("Object is not a supported type for variables");
case TypeCode.DBNull:
throw new NotSupportedException("DBNull is not a supported type for variables");
case TypeCode.Boolean:
value = packet.ReadBoolean();
break;
case TypeCode.Char:
throw new NotSupportedException("Char is not a supported type for variables");
case TypeCode.SByte:
value = packet.ReadSByte();
break;
case TypeCode.Byte:
value = packet.ReadByte();
break;
case TypeCode.Int16:
value = packet.ReadInt16();
break;
case TypeCode.UInt16:
value = packet.ReadUInt16();
break;
case TypeCode.Int32:
value = packet.ReadInt32();
break;
case TypeCode.UInt32:
value = packet.ReadUInt32();
break;
case TypeCode.Int64:
value = packet.ReadInt64();
break;
case TypeCode.UInt64:
value = packet.ReadUInt64();
break;
case TypeCode.Single:
value = packet.ReadSingle();
break;
case TypeCode.Double:
value = packet.ReadDouble();
break;
case TypeCode.Decimal:
throw new NotSupportedException("Decimal is not a supported type for variables");
case TypeCode.DateTime:
throw new NotSupportedException("DateTime is not a supported type for variables");
case TypeCode.String:
value = packet.ReadString();
break;
default:
throw new NotSupportedException(String.Format("Unknown type {0} is not a supported type for variables", typeCode));
}
return value;
}
示例5: Decode
/// <summary>
/// The decode.
/// </summary>
/// <param name="im">
/// The im.
/// </param>
public void Decode(NetIncomingMessage im)
{
this.Id = im.ReadInt64();
this.MessageTime = im.ReadDouble();
this.Position = im.ReadVector2();
this.Velocity = im.ReadVector2();
this.Rotation = im.ReadSingle();
this.Path = im.ReadInt32();
}
示例6: ReadNetworkInstanceInfo
public override void ReadNetworkInstanceInfo(NetIncomingMessage msg)
{
this.iMovetime = msg.ReadInt32();
this.fHeightDif = msg.ReadSingle();
this.xOwner.xRenderComponent.v2OffsetRenderPos.Y = msg.ReadSingle();
}