Beispiel #1
0
        public BeatmapInfo(string filename)
        {
            List <Note>     notes;
            List <LongNote> lns;

            //  Load, and parse.
            if (File.Exists(filename))
            {
                if (filename.Split('.')[filename.Split('.').Length - 1] != "osu")
                {
                    throw new InvalidBeatmapException("Unknown file format.");
                }

                Data = MetadataParser.Parse(filename);
                HitObjectParser.Parse(filename, out notes, out lns, Data.Keys);
            }
            else
            {
                throw new FileNotFoundException();
            }

            //  Calculate densities.
            JenksDensity = DensityCalculator.GetJenksDensity(ref notes, ref lns, Data.Keys);
            JenksSpeed   = DensityCalculator.GetJenksSpeed(ref notes, ref lns);

            //  Copy data.
            Notes = notes;
            LNs   = lns;
        }