当前位置: 首页>>代码示例>>C#>>正文


C# NetIncomingMessage.ReadSingle方法代码示例

本文整理汇总了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();
 }
开发者ID:imGoose,项目名称:SkyrimOnline,代码行数:8,代码来源:UpdatePlayerStateMessage.cs

示例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);
            }
开发者ID:aotis,项目名称:AngryTanks,代码行数:8,代码来源:Messages.cs

示例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);
            }
开发者ID:pr0gramm3r1,项目名称:AngryTanks,代码行数:10,代码来源:Messages.cs

示例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;
            }
开发者ID:pr0gramm3r1,项目名称:AngryTanks,代码行数:78,代码来源:Messages.cs

示例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();
 }
开发者ID:dsummerfield,项目名称:multiplayer-example,代码行数:15,代码来源:EnemySpawnedMessage.cs

示例6: ReadNetworkInstanceInfo

 public override void ReadNetworkInstanceInfo(NetIncomingMessage msg)
 {
     this.iMovetime = msg.ReadInt32();
     this.fHeightDif = msg.ReadSingle();
     this.xOwner.xRenderComponent.v2OffsetRenderPos.Y = msg.ReadSingle();
 }
开发者ID:ancientgods,项目名称:SoG,代码行数:6,代码来源:BallSparkAI.cs


注:本文中的Lidgren.Network.NetIncomingMessage.ReadSingle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。