mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Pass through method instead of instantiating object.
This commit is contained in:
@ -2,6 +2,8 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Game.Beatmaps.Samples;
|
||||
using osu.Game.Beatmaps.Timing;
|
||||
using osu.Game.Database;
|
||||
|
||||
namespace osu.Game.Modes.Objects
|
||||
{
|
||||
@ -26,7 +28,8 @@ namespace osu.Game.Modes.Objects
|
||||
/// <summary>
|
||||
/// Applies default values to this HitObject.
|
||||
/// </summary>
|
||||
/// <param name="defaults">The default values to apply.</param>
|
||||
public virtual void ApplyDefaults(HitObjectDefaults defaults) { }
|
||||
/// <param name="difficulty">The difficulty settings to use.</param>
|
||||
/// <param name="timing">The timing settings to use.</param>
|
||||
public virtual void ApplyDefaults(TimingInfo timing, BaseDifficulty difficulty) { }
|
||||
}
|
||||
}
|
||||
|
@ -1,25 +0,0 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.Timing;
|
||||
using osu.Game.Database;
|
||||
|
||||
namespace osu.Game.Modes.Objects
|
||||
{
|
||||
/// <summary>
|
||||
/// A set of default Beatmap values for HitObjects to consume.
|
||||
/// </summary>
|
||||
public class HitObjectDefaults
|
||||
{
|
||||
/// <summary>
|
||||
/// The Beatmap timing.
|
||||
/// </summary>
|
||||
public TimingInfo Timing;
|
||||
|
||||
/// <summary>
|
||||
/// The Beatmap difficulty.
|
||||
/// </summary>
|
||||
public BaseDifficulty Difficulty;
|
||||
}
|
||||
}
|
@ -9,7 +9,6 @@ using osu.Game.Modes.Judgements;
|
||||
using osu.Game.Modes.Mods;
|
||||
using osu.Game.Modes.Objects;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
using osu.Game.Modes.Objects.Types;
|
||||
using osu.Game.Screens.Play;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -96,14 +95,8 @@ namespace osu.Game.Modes.UI
|
||||
Beatmap = converter.Convert(beatmap.Beatmap);
|
||||
|
||||
// Apply defaults
|
||||
HitObjectDefaults defaults = new HitObjectDefaults
|
||||
{
|
||||
Timing = Beatmap.TimingInfo,
|
||||
Difficulty = Beatmap.BeatmapInfo.BaseDifficulty
|
||||
};
|
||||
|
||||
foreach (var h in Beatmap.HitObjects)
|
||||
h.ApplyDefaults(defaults);
|
||||
h.ApplyDefaults(Beatmap.TimingInfo, Beatmap.BeatmapInfo.BaseDifficulty);
|
||||
|
||||
// Post-process the beatmap
|
||||
processor.PostProcess(Beatmap);
|
||||
|
Reference in New Issue
Block a user