using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YourBeatingHeart.Main.Helper
{
    public static class CurveEditorHelper
    {
        public static float[] ReadCurveFile(string path)
        {
            var fileStream = System.IO.File.Open(path, System.IO.FileMode.Open);
            var br = new System.IO.BinaryReader(fileStream);

            //Get four-byte float-point format
            /*bool IsLittleEndian = */
            br.ReadBoolean(); // Read and throw away

            //allocate needed memory and read values from RAW datafile
            float[] values = new float[(fileStream.Length - 1) / 4];
            for (int i = 0; i < values.Length; i++)
                values[i] = br.ReadSingle();

            br.Close();

            return values;
        }
    }
}
