Пример #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;
        }
Пример #2
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.
            var orgDen = DensityCalculator.GetDensity(ref notes, ref lns);
            var corDen = DensityCalculator.GetCorrectedDensity(ref notes, ref lns, Data.Keys);

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

            MaxDen    = orgDen.Item1;
            AvgDen    = orgDen.Item2;
            CorMaxDen = corDen.Item1;
            CorAvgDen = corDen.Item2;
        }