Add ability to lookup mod from a type specification

This commit is contained in:
Dean Herbert
2021-09-09 16:46:24 +09:00
parent 4d0530ca9d
commit 2edb851008
7 changed files with 32 additions and 7 deletions

View File

@ -4,6 +4,7 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Engines;
using osu.Game.Online.API;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu;
namespace osu.Game.Benchmarks
@ -45,5 +46,17 @@ namespace osu.Game.Benchmarks
{
ruleset.GetAllModsForReference().Consume(new Consumer());
}
[Benchmark]
public void BenchmarkGetForAcronym()
{
ruleset.GetModForAcronym("DT");
}
[Benchmark]
public void BenchmarkGetForType()
{
ruleset.GetMod<ModDoubleTime>();
}
}
}