2019-01-24 16:43:03 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using osu.Framework.Audio.Track;
|
2019-04-25 16:36:17 +08:00
|
|
|
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Framework.Graphics.Textures;
|
|
|
|
|
using osu.Game.Rulesets;
|
2018-05-15 16:38:04 +08:00
|
|
|
|
using osu.Game.Rulesets.Difficulty;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Game.Rulesets.Mods;
|
2018-04-19 21:04:12 +08:00
|
|
|
|
using osu.Game.Rulesets.Objects;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Game.Rulesets.UI;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Beatmaps
|
|
|
|
|
{
|
|
|
|
|
public class DummyWorkingBeatmap : WorkingBeatmap
|
|
|
|
|
{
|
|
|
|
|
private readonly OsuGameBase game;
|
|
|
|
|
|
2018-05-23 16:37:39 +08:00
|
|
|
|
public DummyWorkingBeatmap(OsuGameBase game = null)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
: base(new BeatmapInfo
|
|
|
|
|
{
|
|
|
|
|
Metadata = new BeatmapMetadata
|
|
|
|
|
{
|
|
|
|
|
Artist = "please load a beatmap!",
|
|
|
|
|
Title = "no beatmaps available!"
|
|
|
|
|
},
|
|
|
|
|
BeatmapSet = new BeatmapSetInfo(),
|
2019-03-08 17:17:50 +08:00
|
|
|
|
BaseDifficulty = new BeatmapDifficulty
|
|
|
|
|
{
|
|
|
|
|
DrainRate = 0,
|
|
|
|
|
CircleSize = 0,
|
|
|
|
|
OverallDifficulty = 0,
|
|
|
|
|
},
|
2018-04-13 17:19:50 +08:00
|
|
|
|
Ruleset = new DummyRulesetInfo()
|
|
|
|
|
})
|
|
|
|
|
{
|
|
|
|
|
this.game = game;
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-07 10:22:25 +08:00
|
|
|
|
protected override IBeatmap GetBeatmap() => new Beatmap();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-05-23 16:37:39 +08:00
|
|
|
|
protected override Texture GetBackground() => game?.Textures.Get(@"Backgrounds/bg4");
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-06-28 10:45:48 +08:00
|
|
|
|
protected override Track GetTrack() => new TrackVirtual { Length = 1000 };
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
private class DummyRulesetInfo : RulesetInfo
|
|
|
|
|
{
|
|
|
|
|
public override Ruleset CreateInstance() => new DummyRuleset(this);
|
|
|
|
|
|
|
|
|
|
private class DummyRuleset : Ruleset
|
|
|
|
|
{
|
|
|
|
|
public override IEnumerable<Mod> GetModsFor(ModType type) => new Mod[] { };
|
|
|
|
|
|
2019-04-10 16:13:12 +08:00
|
|
|
|
public override DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap, IReadOnlyList<Mod> mods)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-19 21:04:12 +08:00
|
|
|
|
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new DummyBeatmapConverter { Beatmap = beatmap };
|
|
|
|
|
|
2019-02-21 12:12:37 +08:00
|
|
|
|
public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => null;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
public override string Description => "dummy";
|
|
|
|
|
|
|
|
|
|
public override string ShortName => "dummy";
|
|
|
|
|
|
|
|
|
|
public DummyRuleset(RulesetInfo rulesetInfo = null)
|
|
|
|
|
: base(rulesetInfo)
|
|
|
|
|
{
|
|
|
|
|
}
|
2018-04-19 21:04:12 +08:00
|
|
|
|
|
|
|
|
|
private class DummyBeatmapConverter : IBeatmapConverter
|
|
|
|
|
{
|
|
|
|
|
public event Action<HitObject, IEnumerable<HitObject>> ObjectConverted;
|
2019-04-25 16:36:17 +08:00
|
|
|
|
|
2018-04-19 21:04:12 +08:00
|
|
|
|
public IBeatmap Beatmap { get; set; }
|
2019-04-25 16:36:17 +08:00
|
|
|
|
|
2018-04-19 21:04:12 +08:00
|
|
|
|
public bool CanConvert => true;
|
2019-04-25 16:36:17 +08:00
|
|
|
|
|
|
|
|
|
public IBeatmap Convert()
|
|
|
|
|
{
|
|
|
|
|
foreach (var obj in Beatmap.HitObjects)
|
|
|
|
|
ObjectConverted?.Invoke(obj, obj.Yield());
|
|
|
|
|
|
|
|
|
|
return Beatmap;
|
|
|
|
|
}
|
2018-04-19 21:04:12 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|