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


C# BinaryReader.ReadSingle方法代码示例

本文整理汇总了C#中System.IO.BinaryReader.ReadSingle方法的典型用法代码示例。如果您正苦于以下问题:C# BinaryReader.ReadSingle方法的具体用法?C# BinaryReader.ReadSingle怎么用?C# BinaryReader.ReadSingle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.BinaryReader的用法示例。


在下文中一共展示了BinaryReader.ReadSingle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReadFrom

 internal override void ReadFrom(BinaryReader reader)
 {
     Id = reader.ReadInt32();
     float x = reader.ReadSingle();
     float y = reader.ReadSingle();
     Position = new Vector2(x, y);
 }
开发者ID:NobodysNightmare,项目名称:BlockDefender,代码行数:7,代码来源:PlayerSpawnPacket.cs

示例2: ReadPoint

 private Point3D ReadPoint(BinaryReader reader)
 {
     var x = reader.ReadSingle();
     var y = reader.ReadSingle();
     var z = reader.ReadSingle();
     return new Point3D(x, y, z);
 }
开发者ID:bgbock,项目名称:Hexenstein,代码行数:7,代码来源:PartMesh.cs

示例3: Read

        public IList<IFace> Read(BinaryReader reader)
        {
            int numFaces = reader.ReadInt32();

            for (int i = 0; i < numFaces; i++)
            {
                float materialRotation = reader.ReadSingle();
                float u = reader.ReadSingle();
                float v = reader.ReadSingle();
                float uScale = reader.ReadSingle();
                float vScale = reader.ReadSingle();
                int unknown = reader.ReadInt32();
                int materialIndex = reader.ReadInt32();
                int unknown2 = reader.ReadInt32();

                int numVertices = reader.ReadInt32();

                for (int j = 0; j < numVertices; j++)
                {
                    int unknown3 = reader.ReadInt32();
                    int indice = reader.ReadInt32();
                }

                IFace face = new Face();
                face.MaterialRotation =
                face.U = u;
            }
        }
开发者ID:DamienHauta,项目名称:NS2-Map-Extract,代码行数:28,代码来源:FaceSerializer.cs

示例4: RestoreState

 public void RestoreState(BinaryReader reader)
 {
     var curName = reader.ReadString();
     if (curName != "")
     {
         var loop = reader.ReadBoolean();
         current = new LinearSequence(anims[curName], loop)
                       {
                           Speed = reader.ReadSingle(),
                           Time = reader.ReadSingle()
                       };
     }
     var backupName = reader.ReadString();
     if (backupName != "")
     {
         var loop = reader.ReadBoolean();
         backup = new LinearSequence(anims[backupName], loop)
         {
             Speed = reader.ReadSingle(),
             Time = reader.ReadSingle()
         };
     }
     fadeLeft = reader.ReadSingle();
     fadeTime = reader.ReadSingle();
 }
开发者ID:jyunfan2015,项目名称:Calcifer,代码行数:25,代码来源:BlendAnimationController.cs

示例5: Read

        public static Image Read(BinaryReader Reader)
        {
            Image I = new Image();

              I.m_Width = Reader.ReadInt32();
              I.m_Height = Reader.ReadInt32();

              Reader.ReadSingle();
              Reader.ReadSingle();

              Reader.ReadSingle();
              Reader.ReadSingle();

              I.m_HorizontalFieldOfView = Reader.ReadSingle();
              I.m_VerticalFieldOfView = Reader.ReadSingle();
              long l = Reader.ReadInt64();
              I.m_AquiredOn = DateTime.Now; //= new DateTime(l);
              I.m_SequenceNumber = Reader.ReadInt32();

              I.m_RawPixels = Reader.ReadBytes(I.m_Width * I.m_Height * 3);

              I.m_Pixels = new Color[I.m_Width * I.m_Height];
              for (int i = 0; i < I.m_Pixels.Length; i++)
            I.m_Pixels[i] = Color.FromArgb(I.m_RawPixels[3 * i], I.m_RawPixels[3 * i+1], I.m_RawPixels[3 * i + 2]);

              return I;
        }
开发者ID:anareboucas,项目名称:nanook,代码行数:27,代码来源:Image.cs

示例6: parse

        public override void parse(BinaryReader br, ChunkMap chkMap, Boolean dbg, int chunkLength)
        {
            if (dbg) Console.Out.WriteLine("|-----|" + ChunkHeader.W3D_CHUNK_DEFORM_DATA);

            HeaderID = (int)ChunkHeader.W3D_CHUNK_DEFORM_DATA;
            HeaderName = ChunkHeader.W3D_CHUNK_DEFORM_DATA.ToString();

            for (int i = 0; i < chunkLength / 28; i++)
            {
                vertex_index = br.ReadInt32();
                position = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());

                int R = br.ReadByte();
                int G = br.ReadByte();
                int B = br.ReadByte();
                int A = br.ReadByte();

                color = Color.FromArgb(A, R, G, B);

                //reserved
                for (int i2 = 0; i2 < 2; i2++)
                {
                    reserved[i2] = br.ReadInt32();
                }
            }
        }
开发者ID:RavenB,项目名称:Earth-and-Beyond-server,代码行数:26,代码来源:DeformDataChunk.cs

示例7: ReadFromStream

 /// <summary>
 /// </summary>
 /// <param name="stream">
 /// </param>
 public void ReadFromStream(Stream stream)
 {
     BinaryReader br = new BinaryReader(stream);
     this.X = br.ReadSingle();
     this.Y = br.ReadSingle();
     this.Z = br.ReadSingle();
 }
开发者ID:gordonc64,项目名称:CellAO.Tools,代码行数:11,代码来源:FlatCoordinate.cs

示例8: DeserializeUpdate

        /// <summary>
        /// Deserialisiert Update Daten.
        /// </summary>
        public override void DeserializeUpdate(BinaryReader reader)
        {
            base.DeserializeUpdate(reader);

            // Velocity wieder deserialisieren
            Velocity = new Vector2(reader.ReadSingle(), reader.ReadSingle());
        }
开发者ID:tomwendel,项目名称:RheinwerkAdventure,代码行数:10,代码来源:Character.cs

示例9: Read

 /// <summary>
 /// Reads object data from given BinaryReader.
 /// </summary>
 public void Read(BinaryReader br)
 {
     R = br.ReadSingle();
     G = br.ReadSingle();
     B = br.ReadSingle();
     A = br.ReadSingle();
 }
开发者ID:habanero3d,项目名称:ModelLoader,代码行数:10,代码来源:Color4F.cs

示例10: BuildObject

        private static GameObject BuildObject(Scene scene, BinaryReader reader)
        {
            var id = reader.ReadUInt32();
            var position = new Vector2f(reader.ReadSingle(), reader.ReadSingle());

            return ObjectsManager.Build(id, position);
        }
开发者ID:niemandkun,项目名称:MiraiEngine,代码行数:7,代码来源:SceneManager.cs

示例11: parse

        public override void parse(BinaryReader br, ChunkMap chkMap, Boolean dbg, int chunkLength)
        {
            if (dbg) Console.Out.WriteLine("|----| " + ChunkHeader.W3D_CHUNK_STAGE_TEXCOORDS);

            HeaderID = (int)ChunkHeader.W3D_CHUNK_STAGE_TEXCOORDS;
            HeaderName = ChunkHeader.W3D_CHUNK_STAGE_TEXCOORDS.ToString();

            int NumTexCoords = chunkLength / 8;
            object[] uv = new object[2];
            tex_coord_data = new object[NumTexCoords][];

            for (int i = 0; i < NumTexCoords; i++)
            {
                uv[0] = br.ReadSingle();
                uv[1] = br.ReadSingle();

                tex_coord_data[i] = uv;

                if (dbg)
                {
                    Console.Out.WriteLine("\t Tex Coord #" + i);
                    Console.Out.WriteLine("\t U: " + uv[0] + " V: " + uv[1]);
                }
            }
        }
开发者ID:RavenB,项目名称:Earth-and-Beyond-server,代码行数:25,代码来源:StageTexCoordsChunk.cs

示例12: MagicInfo

        public MagicInfo (BinaryReader reader, int version = int.MaxValue, int Customversion = int.MaxValue)
        {
            Name = reader.ReadString();
            Spell = (Spell)reader.ReadByte();
            BaseCost = reader.ReadByte();
            LevelCost = reader.ReadByte();
            Icon = reader.ReadByte();
            Level1 = reader.ReadByte();
            Level2 = reader.ReadByte();
            Level3 = reader.ReadByte();
            Need1 = reader.ReadUInt16();
            Need2 = reader.ReadUInt16();
            Need3 = reader.ReadUInt16();
            DelayBase = reader.ReadUInt32();
            DelayReduction = reader.ReadUInt32();
            PowerBase = reader.ReadUInt16();
            PowerBonus = reader.ReadUInt16();
            MPowerBase = reader.ReadUInt16();
            MPowerBonus = reader.ReadUInt16();

            if (version > 66)
                Range = reader.ReadByte();
            if (version > 70)
            {
                MultiplierBase = reader.ReadSingle();
                MultiplierBonus = reader.ReadSingle();
            }
        }
开发者ID:Pete107,项目名称:Mir2,代码行数:28,代码来源:MagicInfo.cs

示例13: FromNetwork

 /// <summary>
 /// 
 /// </summary>
 /// <param name="reader"></param>
 public override void FromNetwork(BinaryReader reader)
 {
     VelocityX = reader.ReadSingle();
     VelocityY = reader.ReadSingle();
     X = reader.ReadSingle();
     Y = reader.ReadSingle();
 }
开发者ID:hussein-aitlahcen,项目名称:heroesrpg,代码行数:11,代码来源:MovableEntityPart.cs

示例14: ReadFromFile

        public static void ReadFromFile(string file, out LineSet lineset)
        {
            Line[] lines;

            // Open the file. If it already exists, overwrite.
            using (FileStream fs = File.Open(@file, FileMode.Open))
            {
                using (BinaryReader reader = new BinaryReader(fs))
                {
                    // Write number of lines.
                    lines = new Line[reader.ReadInt32()];

                    // Write line lengths in order.
                    for (int l = 0; l < lines.Length; ++l)
                        lines[l] = new Line() { Positions = new Vector3[reader.ReadInt32()] };

                    // Write positions.
                    float x, y, z;
                    foreach (Line line in lines)
                    {
                        for(int v = 0; v < line.Length; ++v)
                        {
                            x = reader.ReadSingle();
                            y = reader.ReadSingle();
                            z = reader.ReadSingle();
                            line[v] = new Vector3(x, y, z);
                        }
                    }

                }
            }

            lineset = new LineSet(lines);
        }
开发者ID:AnkeAnke,项目名称:FlowSharp,代码行数:34,代码来源:GeometryWriter.cs

示例15: ReadHeader

 /// <inheritdoc></inheritdoc>
 public override void ReadHeader()
 {
     string location = FileIsEmbedded ? ManifestResourceString : GridFilePath;
     Name = Path.GetFileNameWithoutExtension(location);
     using (Stream str = GetStream())
     {
         if (str == null) return;
         using (BinaryReader br = new BinaryReader(str))
         {
             // read past 64 bytes of strings/nulls at start of file
             br.BaseStream.Seek(64, SeekOrigin.Begin);
             NumLambdas = br.ReadInt32();
             NumPhis = br.ReadInt32();
             br.ReadInt32(); // num z values: always 1
             PhiLam ll;
             ll.Lambda = br.ReadSingle() * DEG_TO_RAD;
             PhiLam cs;
             cs.Lambda = br.ReadSingle() * DEG_TO_RAD;
             ll.Phi = br.ReadSingle() * DEG_TO_RAD;
             LowerLeft = ll;
             cs.Phi = br.ReadSingle() * DEG_TO_RAD;
             CellSize = cs;
             Filled = false;
         }
     }
 }
开发者ID:DIVEROVIEDO,项目名称:DotSpatial,代码行数:27,代码来源:LasLosNadTable.cs


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