mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 03:22:57 +08:00
Rename GetSampleInfo
to better describe what method does
Also add full xmldoc
This commit is contained in:
parent
a8bc337006
commit
dc51d5ecf3
@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Catch.Objects
|
|||||||
{
|
{
|
||||||
StartTime = time,
|
StartTime = time,
|
||||||
BananaIndex = i,
|
BananaIndex = i,
|
||||||
Samples = new List<HitSampleInfo> { new Banana.BananaHitSampleInfo(GetSampleInfo().Volume) }
|
Samples = new List<HitSampleInfo> { new Banana.BananaHitSampleInfo(CreateHitSampleInfo().Volume) }
|
||||||
});
|
});
|
||||||
|
|
||||||
time += spacing;
|
time += spacing;
|
||||||
|
@ -72,7 +72,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
|
|
||||||
AddNested(i < SpinsRequired
|
AddNested(i < SpinsRequired
|
||||||
? new SpinnerTick { StartTime = startTime, SpinnerDuration = Duration }
|
? new SpinnerTick { StartTime = startTime, SpinnerDuration = Duration }
|
||||||
: new SpinnerBonusTick { StartTime = startTime, SpinnerDuration = Duration, Samples = new[] { GetSampleInfo("spinnerbonus") } });
|
: new SpinnerBonusTick { StartTime = startTime, SpinnerDuration = Duration, Samples = new[] { CreateHitSampleInfo("spinnerbonus") } });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ namespace osu.Game.Rulesets.Taiko.Objects
|
|||||||
if (isRimType != rimSamples.Any())
|
if (isRimType != rimSamples.Any())
|
||||||
{
|
{
|
||||||
if (isRimType)
|
if (isRimType)
|
||||||
Samples.Add(GetSampleInfo(HitSampleInfo.HIT_CLAP));
|
Samples.Add(CreateHitSampleInfo(HitSampleInfo.HIT_CLAP));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach (var sample in rimSamples)
|
foreach (var sample in rimSamples)
|
||||||
|
@ -56,7 +56,7 @@ namespace osu.Game.Rulesets.Taiko.Objects
|
|||||||
if (IsStrongBindable.Value != strongSamples.Any())
|
if (IsStrongBindable.Value != strongSamples.Any())
|
||||||
{
|
{
|
||||||
if (IsStrongBindable.Value)
|
if (IsStrongBindable.Value)
|
||||||
Samples.Add(GetSampleInfo(HitSampleInfo.HIT_FINISH));
|
Samples.Add(CreateHitSampleInfo(HitSampleInfo.HIT_FINISH));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach (var sample in strongSamples)
|
foreach (var sample in strongSamples)
|
||||||
|
@ -206,14 +206,20 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a SampleInfo based on the sample settings of the hit normal sample in <see cref="Samples"/>.
|
/// Create a <see cref="HitSampleInfo"/> based on the sample settings of the first <see cref="HitSampleInfo.HIT_NORMAL"/> sample in <see cref="Samples"/>.
|
||||||
|
/// If no sample is available, sane default settings will be used instead.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// In the case an existing sample exists, all settings apart from the sample name will be inherited. This includes volume, bank and suffix.
|
||||||
|
/// </remarks>
|
||||||
/// <param name="sampleName">The name of the sample.</param>
|
/// <param name="sampleName">The name of the sample.</param>
|
||||||
/// <returns>A populated <see cref="HitSampleInfo"/>.</returns>
|
/// <returns>A populated <see cref="HitSampleInfo"/>.</returns>
|
||||||
public HitSampleInfo GetSampleInfo(string sampleName = HitSampleInfo.HIT_NORMAL)
|
public HitSampleInfo CreateHitSampleInfo(string sampleName = HitSampleInfo.HIT_NORMAL)
|
||||||
{
|
{
|
||||||
var hitnormalSample = Samples.FirstOrDefault(s => s.Name == HitSampleInfo.HIT_NORMAL);
|
if (Samples.FirstOrDefault(s => s.Name == HitSampleInfo.HIT_NORMAL) is HitSampleInfo existingSample)
|
||||||
return hitnormalSample == null ? new HitSampleInfo(sampleName) : hitnormalSample.With(newName: sampleName);
|
return existingSample.With(newName: sampleName);
|
||||||
|
|
||||||
|
return new HitSampleInfo(sampleName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
case TernaryState.True:
|
case TernaryState.True:
|
||||||
if (existingSample == null)
|
if (existingSample == null)
|
||||||
samples.Add(CurrentPlacement.HitObject.GetSampleInfo(sampleName));
|
samples.Add(CurrentPlacement.HitObject.CreateHitSampleInfo(sampleName));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
if (h.Samples.Any(s => s.Name == sampleName))
|
if (h.Samples.Any(s => s.Name == sampleName))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
h.Samples.Add(h.GetSampleInfo(sampleName));
|
h.Samples.Add(h.CreateHitSampleInfo(sampleName));
|
||||||
EditorBeatmap.Update(h);
|
EditorBeatmap.Update(h);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user