mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
HitRenderer -> RulesetContainer
This commit is contained in:
@ -7,16 +7,16 @@ using osu.Game.Rulesets.UI;
|
||||
namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
/// <summary>
|
||||
/// An interface for mods that are applied to a HitRenderer.
|
||||
/// An interface for mods that are applied to a RulesetContainer.
|
||||
/// </summary>
|
||||
/// <typeparam name="TObject">The type of HitObject the HitRenderer contains.</typeparam>
|
||||
/// <typeparam name="TObject">The type of HitObject the RulesetContainer contains.</typeparam>
|
||||
public interface IApplicableMod<TObject>
|
||||
where TObject : HitObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Applies the mod to a HitRenderer.
|
||||
/// Applies the mod to a RulesetContainer.
|
||||
/// </summary>
|
||||
/// <param name="hitRenderer">The HitRenderer to apply the mod to.</param>
|
||||
void ApplyToHitRenderer(HitRenderer<TObject> hitRenderer);
|
||||
/// <param name="rulesetContainer">The RulesetContainer to apply the mod to.</param>
|
||||
void ApplyToRulesetContainer(RulesetContainer<TObject> rulesetContainer);
|
||||
}
|
||||
}
|
||||
|
@ -15,9 +15,9 @@ namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
protected abstract Score CreateReplayScore(Beatmap<T> beatmap);
|
||||
|
||||
public void ApplyToHitRenderer(HitRenderer<T> hitRenderer)
|
||||
public void ApplyToRulesetContainer(RulesetContainer<T> rulesetContainer)
|
||||
{
|
||||
hitRenderer.SetReplay(CreateReplayScore(hitRenderer.Beatmap)?.Replay);
|
||||
rulesetContainer.SetReplay(CreateReplayScore(rulesetContainer.Beatmap)?.Replay);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Rulesets
|
||||
/// <param name="isForCurrentRuleset">Whether the hit renderer should assume the beatmap is for the current ruleset.</param>
|
||||
/// <exception cref="BeatmapInvalidForRulesetException">Unable to successfully load the beatmap to be usable with this ruleset.</exception>
|
||||
/// <returns></returns>
|
||||
public abstract HitRenderer CreateHitRendererWith(WorkingBeatmap beatmap, bool isForCurrentRuleset);
|
||||
public abstract RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset);
|
||||
|
||||
public abstract DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap);
|
||||
|
||||
|
@ -150,13 +150,13 @@ namespace osu.Game.Rulesets.Scoring
|
||||
{
|
||||
}
|
||||
|
||||
protected ScoreProcessor(HitRenderer<TObject, TJudgement> hitRenderer)
|
||||
protected ScoreProcessor(RulesetContainer<TObject, TJudgement> rulesetContainer)
|
||||
{
|
||||
Judgements.Capacity = hitRenderer.Beatmap.HitObjects.Count;
|
||||
Judgements.Capacity = rulesetContainer.Beatmap.HitObjects.Count;
|
||||
|
||||
hitRenderer.OnJudgement += AddJudgement;
|
||||
rulesetContainer.OnJudgement += AddJudgement;
|
||||
|
||||
ComputeTargets(hitRenderer.Beatmap);
|
||||
ComputeTargets(rulesetContainer.Beatmap);
|
||||
|
||||
Reset();
|
||||
}
|
||||
|
@ -23,12 +23,12 @@ using osu.Game.Rulesets.Beatmaps;
|
||||
namespace osu.Game.Rulesets.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// Base HitRenderer. Doesn't hold objects.
|
||||
/// Base RulesetContainer. Doesn't hold objects.
|
||||
/// <para>
|
||||
/// Should not be derived - derive <see cref="HitRenderer{TObject, TJudgement}"/> instead.
|
||||
/// Should not be derived - derive <see cref="RulesetContainer{TObject,TJudgement}"/> instead.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public abstract class HitRenderer : Container
|
||||
public abstract class RulesetContainer : Container
|
||||
{
|
||||
/// <summary>
|
||||
/// Invoked when all the judgeable HitObjects have been judged.
|
||||
@ -41,12 +41,12 @@ namespace osu.Game.Rulesets.UI
|
||||
public bool AspectAdjust = true;
|
||||
|
||||
/// <summary>
|
||||
/// The input manager for this HitRenderer.
|
||||
/// The input manager for this RulesetContainer.
|
||||
/// </summary>
|
||||
internal readonly PlayerInputManager InputManager = new PlayerInputManager();
|
||||
|
||||
/// <summary>
|
||||
/// The key conversion input manager for this HitRenderer.
|
||||
/// The key conversion input manager for this RulesetContainer.
|
||||
/// </summary>
|
||||
protected readonly PassThroughInputManager KeyConversionInputManager;
|
||||
|
||||
@ -73,7 +73,7 @@ namespace osu.Game.Rulesets.UI
|
||||
/// A visual representation of a <see cref="Rulesets.Ruleset"/>.
|
||||
/// </summary>
|
||||
/// <param name="ruleset">The ruleset being repesented.</param>
|
||||
internal HitRenderer(Ruleset ruleset)
|
||||
internal RulesetContainer(Ruleset ruleset)
|
||||
{
|
||||
Ruleset = ruleset;
|
||||
KeyConversionInputManager = CreateActionMappingInputManager();
|
||||
@ -113,14 +113,14 @@ namespace osu.Game.Rulesets.UI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// HitRenderer that applies conversion to Beatmaps. Does not contain a Playfield
|
||||
/// RulesetContainer that applies conversion to Beatmaps. Does not contain a Playfield
|
||||
/// and does not load drawable hit objects.
|
||||
/// <para>
|
||||
/// Should not be derived - derive <see cref="HitRenderer{TObject, TJudgement}"/> instead.
|
||||
/// Should not be derived - derive <see cref="RulesetContainer{TObject,TJudgement}"/> instead.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <typeparam name="TObject">The type of HitObject contained by this HitRenderer.</typeparam>
|
||||
public abstract class HitRenderer<TObject> : HitRenderer
|
||||
/// <typeparam name="TObject">The type of HitObject contained by this RulesetContainer.</typeparam>
|
||||
public abstract class RulesetContainer<TObject> : RulesetContainer
|
||||
where TObject : HitObject
|
||||
{
|
||||
/// <summary>
|
||||
@ -144,9 +144,9 @@ namespace osu.Game.Rulesets.UI
|
||||
/// <param name="ruleset">The ruleset being repesented.</param>
|
||||
/// <param name="beatmap">The beatmap to create the hit renderer for.</param>
|
||||
/// <param name="isForCurrentRuleset">Whether to assume the beatmap is for the current ruleset.</param>
|
||||
internal HitRenderer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) : base(ruleset)
|
||||
internal RulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) : base(ruleset)
|
||||
{
|
||||
Debug.Assert(beatmap != null, "HitRenderer initialized with a null beatmap.");
|
||||
Debug.Assert(beatmap != null, "RulesetContainer initialized with a null beatmap.");
|
||||
|
||||
Mods = beatmap.Mods.Value;
|
||||
|
||||
@ -180,7 +180,7 @@ namespace osu.Game.Rulesets.UI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Applies the active mods to this HitRenderer.
|
||||
/// Applies the active mods to this RulesetContainer.
|
||||
/// </summary>
|
||||
/// <param name="mods"></param>
|
||||
private void applyMods(IEnumerable<Mod> mods)
|
||||
@ -189,7 +189,7 @@ namespace osu.Game.Rulesets.UI
|
||||
return;
|
||||
|
||||
foreach (var mod in mods.OfType<IApplicableMod<TObject>>())
|
||||
mod.ApplyToHitRenderer(this);
|
||||
mod.ApplyToRulesetContainer(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -212,11 +212,11 @@ namespace osu.Game.Rulesets.UI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A derivable HitRenderer that manages the Playfield and HitObjects.
|
||||
/// A derivable RulesetContainer that manages the Playfield and HitObjects.
|
||||
/// </summary>
|
||||
/// <typeparam name="TObject">The type of HitObject contained by this HitRenderer.</typeparam>
|
||||
/// <typeparam name="TJudgement">The type of Judgement of DrawableHitObjects contained by this HitRenderer.</typeparam>
|
||||
public abstract class HitRenderer<TObject, TJudgement> : HitRenderer<TObject>
|
||||
/// <typeparam name="TObject">The type of HitObject contained by this RulesetContainer.</typeparam>
|
||||
/// <typeparam name="TJudgement">The type of Judgement of DrawableHitObjects contained by this RulesetContainer.</typeparam>
|
||||
public abstract class RulesetContainer<TObject, TJudgement> : RulesetContainer<TObject>
|
||||
where TObject : HitObject
|
||||
where TJudgement : Judgement
|
||||
{
|
||||
@ -247,7 +247,7 @@ namespace osu.Game.Rulesets.UI
|
||||
/// <param name="ruleset">The ruleset being repesented.</param>
|
||||
/// <param name="beatmap">The beatmap to create the hit renderer for.</param>
|
||||
/// <param name="isForCurrentRuleset">Whether to assume the beatmap is for the current ruleset.</param>
|
||||
protected HitRenderer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset)
|
||||
protected RulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset)
|
||||
: base(ruleset, beatmap, isForCurrentRuleset)
|
||||
{
|
||||
InputManager.Add(content = new Container
|
||||
@ -334,12 +334,12 @@ namespace osu.Game.Rulesets.UI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A derivable HitRenderer that manages the Playfield and HitObjects.
|
||||
/// A derivable RulesetContainer that manages the Playfield and HitObjects.
|
||||
/// </summary>
|
||||
/// <typeparam name="TPlayfield">The type of Playfield contained by this HitRenderer.</typeparam>
|
||||
/// <typeparam name="TObject">The type of HitObject contained by this HitRenderer.</typeparam>
|
||||
/// <typeparam name="TJudgement">The type of Judgement of DrawableHitObjects contained by this HitRenderer.</typeparam>
|
||||
public abstract class HitRenderer<TPlayfield, TObject, TJudgement> : HitRenderer<TObject, TJudgement>
|
||||
/// <typeparam name="TPlayfield">The type of Playfield contained by this RulesetContainer.</typeparam>
|
||||
/// <typeparam name="TObject">The type of HitObject contained by this RulesetContainer.</typeparam>
|
||||
/// <typeparam name="TJudgement">The type of Judgement of DrawableHitObjects contained by this RulesetContainer.</typeparam>
|
||||
public abstract class RulesetContainer<TPlayfield, TObject, TJudgement> : RulesetContainer<TObject, TJudgement>
|
||||
where TObject : HitObject
|
||||
where TJudgement : Judgement
|
||||
where TPlayfield : Playfield<TObject, TJudgement>
|
||||
@ -355,7 +355,7 @@ namespace osu.Game.Rulesets.UI
|
||||
/// <param name="ruleset">The ruleset being repesented.</param>
|
||||
/// <param name="beatmap">The beatmap to create the hit renderer for.</param>
|
||||
/// <param name="isForCurrentRuleset">Whether to assume the beatmap is for the current ruleset.</param>
|
||||
protected HitRenderer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset)
|
||||
protected RulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset)
|
||||
: base(ruleset, beatmap, isForCurrentRuleset)
|
||||
{
|
||||
}
|
@ -17,22 +17,22 @@ using osu.Game.Rulesets.Timing;
|
||||
namespace osu.Game.Rulesets.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// A type of <see cref="HitRenderer{TPlayfield, TObject, TJudgement}"/> that supports a <see cref="ScrollingPlayfield{TObject, TJudgement}"/>.
|
||||
/// <see cref="HitObject"/>s inside this <see cref="HitRenderer{TPlayfield, TObject, TJudgement}"/> will scroll within the playfield.
|
||||
/// A type of <see cref="RulesetContainer{TPlayfield,TObject,TJudgement}"/> that supports a <see cref="ScrollingPlayfield{TObject, TJudgement}"/>.
|
||||
/// <see cref="HitObject"/>s inside this <see cref="RulesetContainer{TPlayfield,TObject,TJudgement}"/> will scroll within the playfield.
|
||||
/// </summary>
|
||||
public abstract class ScrollingHitRenderer<TPlayfield, TObject, TJudgement> : HitRenderer<TPlayfield, TObject, TJudgement>
|
||||
public abstract class ScrollingRulesetContainer<TPlayfield, TObject, TJudgement> : RulesetContainer<TPlayfield, TObject, TJudgement>
|
||||
where TObject : HitObject
|
||||
where TJudgement : Judgement
|
||||
where TPlayfield : ScrollingPlayfield<TObject, TJudgement>
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides the default <see cref="MultiplierControlPoint"/>s that adjust the scrolling rate of <see cref="HitObject"/>s
|
||||
/// inside this <see cref="HitRenderer{TPlayfield, TObject, TJudgement}"/>.
|
||||
/// inside this <see cref="RulesetContainer{TPlayfield,TObject,TJudgement}"/>.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected readonly SortedList<MultiplierControlPoint> DefaultControlPoints = new SortedList<MultiplierControlPoint>(Comparer<MultiplierControlPoint>.Default);
|
||||
|
||||
protected ScrollingHitRenderer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset)
|
||||
protected ScrollingRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset)
|
||||
: base(ruleset, beatmap, isForCurrentRuleset)
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user