This repository has been archived by the owner on Jun 11, 2023. It is now read-only.
forked from ppy/osu
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
264 changed files
with
4,993 additions
and
3,043 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using osu.Framework.Extensions.IEnumerableExtensions; | ||
using osu.Game.Beatmaps; | ||
using osu.Game.Rulesets; | ||
using osu.Game.Rulesets.Difficulty; | ||
using osu.Game.Rulesets.Mods; | ||
using osu.Game.Rulesets.Objects; | ||
using osu.Game.Rulesets.UI; | ||
using osu.Game.Skinning; | ||
|
||
namespace Mvis.Plugin.FakeEditor.Editor | ||
{ | ||
/// <summary> | ||
/// From osu.Game/Beatmaps/DummyWorkingBeatmap.cs | ||
/// <see cref="osu.Game.Beatmaps.DummyWorkingBeatmap"/> | ||
/// </summary> | ||
public class DummyRulesetInfo : RulesetInfo | ||
{ | ||
public override Ruleset CreateInstance() => new DummyRuleset(); | ||
|
||
private class DummyRuleset : Ruleset | ||
{ | ||
public override IEnumerable<Mod> GetModsFor(ModType type) => Array.Empty<Mod>(); | ||
|
||
public override ISkin CreateLegacySkinProvider(ISkin skin, IBeatmap beatmap) => new DummySkinProvider(); | ||
|
||
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod> mods = null) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) | ||
=> new DummyBeatmapConverter { Beatmap = beatmap }; | ||
|
||
public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => null; | ||
|
||
public override string Description => "desc"; | ||
|
||
public override string ShortName => "name"; | ||
|
||
private class DummyBeatmapConverter : IBeatmapConverter | ||
{ | ||
public event Action<HitObject, IEnumerable<HitObject>> ObjectConverted; | ||
|
||
public IBeatmap Beatmap { get; set; } | ||
|
||
public bool CanConvert() => true; | ||
|
||
public IBeatmap Convert(CancellationToken cancellationToken = default) | ||
{ | ||
foreach (var obj in Beatmap.HitObjects) | ||
ObjectConverted?.Invoke(obj, obj.Yield()); | ||
|
||
return Beatmap; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using osu.Framework.Audio.Sample; | ||
using osu.Framework.Bindables; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.OpenGL.Textures; | ||
using osu.Framework.Graphics.Textures; | ||
using osu.Game.Audio; | ||
using osu.Game.Skinning; | ||
|
||
namespace Mvis.Plugin.FakeEditor.Editor | ||
{ | ||
public class DummySkinProvider : ISkin | ||
{ | ||
public Drawable GetDrawableComponent(ISkinComponent component) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Texture GetTexture(string componentName, WrapMode wrapModeS, WrapMode wrapModeT) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public ISample GetSample(ISampleInfo sampleInfo) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System; | ||
using BenchmarkDotNet.Attributes; | ||
using osu.Game.Rulesets.Osu.Mods; | ||
|
||
namespace osu.Game.Benchmarks | ||
{ | ||
public class BenchmarkMod : BenchmarkTest | ||
{ | ||
private OsuModDoubleTime mod; | ||
|
||
[Params(1, 10, 100)] | ||
public int Times { get; set; } | ||
|
||
[GlobalSetup] | ||
public void GlobalSetup() | ||
{ | ||
mod = new OsuModDoubleTime(); | ||
} | ||
|
||
[Benchmark] | ||
public int ModHashCode() | ||
{ | ||
var hashCode = new HashCode(); | ||
|
||
for (int i = 0; i < Times; i++) | ||
hashCode.Add(mod); | ||
|
||
return hashCode.ToHashCode(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.