1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-07 01:07:24 +08:00
osu-lazer/osu.Game/Beatmaps/DummyWorkingBeatmap.cs

74 lines
2.4 KiB
C#
Raw Normal View History

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