osu/osu.Game/Beatmaps/DummyWorkingBeatmap.cs

75 lines
2.5 KiB
C#
Raw Normal View History

2018-01-05 11:21:19 +00:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2017-07-19 09:02:11 +00:00
using System;
using System.Collections.Generic;
using osu.Framework.Audio.Track;
using osu.Framework.Graphics.Textures;
2017-07-19 00:59:47 +00:00
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.UI;
namespace osu.Game.Beatmaps
{
public class DummyWorkingBeatmap : WorkingBeatmap
{
2017-07-19 04:32:16 +00:00
private readonly OsuGameBase game;
2017-07-18 08:59:43 +00:00
2017-07-19 04:32:16 +00:00
public DummyWorkingBeatmap(OsuGameBase game)
: base(new BeatmapInfo
{
Metadata = new BeatmapMetadata
{
Artist = "please load a beatmap!",
Title = "no beatmaps available!"
},
BeatmapSet = new BeatmapSetInfo(),
2017-10-19 05:05:11 +00:00
BaseDifficulty = new BeatmapDifficulty
{
DrainRate = 0,
CircleSize = 0,
OverallDifficulty = 0,
ApproachRate = 0,
SliderMultiplier = 0,
SliderTickRate = 0,
},
2017-07-19 00:59:47 +00:00
Ruleset = new DummyRulesetInfo()
})
{
2017-07-18 08:59:43 +00:00
this.game = game;
}
protected override Beatmap GetBeatmap() => new Beatmap();
2017-07-18 08:59:43 +00:00
protected override Texture GetBackground() => game.Textures.Get(@"Backgrounds/bg4");
protected override Track GetTrack() => new TrackVirtual();
2017-07-19 00:59:47 +00:00
private class DummyRulesetInfo : RulesetInfo
{
public override Ruleset CreateInstance() => new DummyRuleset(this);
2017-07-19 00:59:47 +00:00
private class DummyRuleset : Ruleset
{
public override IEnumerable<Mod> GetModsFor(ModType type) => new Mod[] { };
2017-08-09 04:28:29 +00:00
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset)
2017-07-19 00:59:47 +00:00
{
2017-07-19 09:02:11 +00:00
throw new NotImplementedException();
2017-07-19 00:59:47 +00:00
}
public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => null;
2017-07-19 00:59:47 +00:00
public override string Description => "dummy";
2017-12-08 09:55:25 +00:00
public override string ShortName => "dummy";
public DummyRuleset(RulesetInfo rulesetInfo)
: base(rulesetInfo)
{
}
2017-07-19 00:59:47 +00:00
}
}
}
}