mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:17:51 +08:00
Refactor if/else as ternary conditional
This commit is contained in:
parent
730f198c45
commit
18dc375fe9
@ -220,18 +220,13 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
var samplePoint = legacyControlPoints.SamplePointAt(group.Time);
|
var samplePoint = legacyControlPoints.SamplePointAt(group.Time);
|
||||||
var effectPoint = legacyControlPoints.EffectPointAt(group.Time);
|
var effectPoint = legacyControlPoints.EffectPointAt(group.Time);
|
||||||
|
|
||||||
// if samplePoint isn't already legacy,create LegacyHitSampleInfo with customSampleBank 1
|
// if samplePoint isn't already legacy, create LegacyHitSampleInfo with customSampleBank 1
|
||||||
HitSampleInfo tempHitSample;
|
|
||||||
|
|
||||||
if (samplePoint.GetType() == typeof(SampleControlPoint))
|
|
||||||
{
|
|
||||||
tempHitSample = samplePoint.ApplyTo(new ConvertHitObjectParser.LegacyHitSampleInfo(string.Empty, customSampleBank: 1));
|
|
||||||
}
|
|
||||||
// else create LegacyHitSampleInfo with existing customSampleBank
|
// else create LegacyHitSampleInfo with existing customSampleBank
|
||||||
else
|
HitSampleInfo tempHitSample = samplePoint.ApplyTo(
|
||||||
{
|
samplePoint.GetType() == typeof(SampleControlPoint)
|
||||||
tempHitSample = samplePoint.ApplyTo(new ConvertHitObjectParser.LegacyHitSampleInfo(string.Empty));
|
? new ConvertHitObjectParser.LegacyHitSampleInfo(string.Empty, customSampleBank: 1)
|
||||||
}
|
: new ConvertHitObjectParser.LegacyHitSampleInfo(string.Empty)
|
||||||
|
);
|
||||||
|
|
||||||
// Apply the control point to a hit sample to uncover legacy properties (e.g. suffix)
|
// Apply the control point to a hit sample to uncover legacy properties (e.g. suffix)
|
||||||
int customSampleBank = toLegacyCustomSampleBank(tempHitSample);
|
int customSampleBank = toLegacyCustomSampleBank(tempHitSample);
|
||||||
|
Loading…
Reference in New Issue
Block a user