Exemple #1
0
 private IBeatmap readBeatmap(byte[] state)
 {
     using (var stream = new MemoryStream(state))
         using (var reader = new LineBufferedReader(stream, true))
         {
             var decoded = Decoder.GetDecoder <Beatmap>(reader).Decode(reader);
             decoded.BeatmapInfo.Ruleset = editorBeatmap.BeatmapInfo.Ruleset;
             return(new PassThroughWorkingBeatmap(decoded).GetPlayableBeatmap(editorBeatmap.BeatmapInfo.Ruleset));
         }
 }
Exemple #2
0
        private static Beatmap createTestBeatmap()
        {
            using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(test_beatmap_data)))
            {
                using (var reader = new LineBufferedReader(stream))
                {
                    var b = Decoder.GetDecoder <Beatmap>(reader).Decode(reader);

                    b.BeatmapInfo.MD5Hash = test_beatmap_hash.Value.md5;
                    b.BeatmapInfo.Hash    = test_beatmap_hash.Value.sha2;

                    return(b);
                }
            }
        }
Exemple #3
0
        public void TestStacking()
        {
            using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(beatmap_data)))
                using (var reader = new StreamReader(stream))
                {
                    var beatmap   = Decoder.GetDecoder <Beatmap>(reader).Decode(reader);
                    var converted = new TestWorkingBeatmap(beatmap).GetPlayableBeatmap(new OsuRuleset().RulesetInfo, Array.Empty <Mod>());

                    var objects = converted.HitObjects.ToList();

                    // The last hitobject triggers the stacking
                    for (int i = 0; i < objects.Count - 1; i++)
                    {
                        Assert.AreEqual(0, ((OsuHitObject)objects[i]).StackHeight);
                    }
                }
        }
Exemple #4
0
 private static Beatmap createTestBeatmap()
 {
     using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(test_beatmap_data)))
         using (var reader = new LineBufferedReader(stream))
             return(Decoder.GetDecoder <Beatmap>(reader).Decode(reader));
 }