mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:37:28 +08:00
tidy up code
This commit is contained in:
parent
a42bfcb5ab
commit
aa476835e7
@ -17,11 +17,12 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
||||
{
|
||||
public TestSceneDrawableJudgement()
|
||||
{
|
||||
var HitWindows = new ManiaHitWindows();
|
||||
var hitWindows = new ManiaHitWindows();
|
||||
|
||||
foreach (HitResult result in Enum.GetValues(typeof(HitResult)).OfType<HitResult>().Skip(1))
|
||||
{
|
||||
if (HitWindows.IsHitResultAllowed(result))
|
||||
if (hitWindows.IsHitResultAllowed(result))
|
||||
{
|
||||
AddStep("Show " + result.GetDescription(), () => SetContents(() =>
|
||||
new DrawableManiaJudgement(new JudgementResult(new HitObject(), new Judgement()) { Type = result }, null)
|
||||
{
|
||||
@ -32,3 +33,4 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Mania.Skinning
|
||||
/// Mapping of <see cref="HitResult"/> to ther corresponding
|
||||
/// <see cref="LegacyManiaSkinConfigurationLookups"/> value.
|
||||
/// </summary>
|
||||
private static readonly IReadOnlyDictionary<HitResult, LegacyManiaSkinConfigurationLookups> componentMapping
|
||||
private static readonly IReadOnlyDictionary<HitResult, LegacyManiaSkinConfigurationLookups> hitresult_mapping
|
||||
= new Dictionary<HitResult, LegacyManiaSkinConfigurationLookups>
|
||||
{
|
||||
{ HitResult.Perfect, LegacyManiaSkinConfigurationLookups.Hit300g },
|
||||
@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Mania.Skinning
|
||||
/// Mapping of <see cref="HitResult"/> to their corresponding
|
||||
/// default filenames.
|
||||
/// </summary>
|
||||
private static readonly IReadOnlyDictionary<HitResult, string> defaultName
|
||||
private static readonly IReadOnlyDictionary<HitResult, string> default_hitresult_skin_filenames
|
||||
= new Dictionary<HitResult, string>
|
||||
{
|
||||
{ HitResult.Perfect, "mania-hit300g" },
|
||||
@ -129,8 +129,8 @@ namespace osu.Game.Rulesets.Mania.Skinning
|
||||
private Drawable getResult(HitResult result)
|
||||
{
|
||||
string image = GetConfig<ManiaSkinConfigurationLookup, string>(
|
||||
new ManiaSkinConfigurationLookup(componentMapping[result])
|
||||
)?.Value ?? defaultName[result];
|
||||
new ManiaSkinConfigurationLookup(hitresult_mapping[result])
|
||||
)?.Value ?? default_hitresult_skin_filenames[result];
|
||||
|
||||
return this.GetAnimation(image, true, true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user