1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

remove constructor argument from Banana

This commit is contained in:
OliBomby 2023-05-02 12:41:39 +02:00
parent d2d81bb82c
commit 90d98cd329
2 changed files with 9 additions and 4 deletions

View File

@ -22,9 +22,11 @@ namespace osu.Game.Rulesets.Catch.Objects
public override Judgement CreateJudgement() => new CatchBananaJudgement();
public Banana(int volume = 100)
private static readonly List<HitSampleInfo> samples = new List<HitSampleInfo> { new BananaHitSampleInfo() };
public Banana()
{
Samples = new List<HitSampleInfo> { new BananaHitSampleInfo(volume) };
Samples = samples;
}
// override any external colour changes with banananana
@ -45,7 +47,7 @@ namespace osu.Game.Rulesets.Catch.Objects
}
}
private class BananaHitSampleInfo : HitSampleInfo, IEquatable<BananaHitSampleInfo>
public class BananaHitSampleInfo : HitSampleInfo, IEquatable<BananaHitSampleInfo>
{
private static readonly string[] lookup_names = { "Gameplay/metronomelow", "Gameplay/catch-banana" };

View File

@ -1,7 +1,9 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Threading;
using osu.Game.Audio;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects.Types;
@ -35,10 +37,11 @@ namespace osu.Game.Rulesets.Catch.Objects
{
cancellationToken.ThrowIfCancellationRequested();
AddNested(new Banana(GetSampleInfo().Volume)
AddNested(new Banana
{
StartTime = time,
BananaIndex = i,
Samples = new List<HitSampleInfo> { new Banana.BananaHitSampleInfo(GetSampleInfo().Volume) }
});
time += spacing;