mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 08:53:20 +08:00
Fix DrawableRuleset drawable creation method's name
This commit is contained in:
parent
8c8c761e02
commit
9bf48863b0
@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
{
|
{
|
||||||
private readonly Container bananaContainer;
|
private readonly Container bananaContainer;
|
||||||
|
|
||||||
public DrawableBananaShower(BananaShower s, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> getVisualRepresentation = null)
|
public DrawableBananaShower(BananaShower s, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> createDrawableRepresentation = null)
|
||||||
: base(s)
|
: base(s)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
InternalChild = bananaContainer = new Container { RelativeSizeAxes = Axes.Both };
|
InternalChild = bananaContainer = new Container { RelativeSizeAxes = Axes.Both };
|
||||||
|
|
||||||
foreach (var b in s.NestedHitObjects.Cast<Banana>())
|
foreach (var b in s.NestedHitObjects.Cast<Banana>())
|
||||||
AddNested(getVisualRepresentation?.Invoke(b));
|
AddNested(createDrawableRepresentation?.Invoke(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void AddNested(DrawableHitObject h)
|
protected override void AddNested(DrawableHitObject h)
|
||||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
{
|
{
|
||||||
private readonly Container dropletContainer;
|
private readonly Container dropletContainer;
|
||||||
|
|
||||||
public DrawableJuiceStream(JuiceStream s, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> getVisualRepresentation = null)
|
public DrawableJuiceStream(JuiceStream s, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> createDrawableRepresentation = null)
|
||||||
: base(s)
|
: base(s)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
InternalChild = dropletContainer = new Container { RelativeSizeAxes = Axes.Both, };
|
InternalChild = dropletContainer = new Container { RelativeSizeAxes = Axes.Both, };
|
||||||
|
|
||||||
foreach (var o in s.NestedHitObjects.Cast<CatchHitObject>())
|
foreach (var o in s.NestedHitObjects.Cast<CatchHitObject>())
|
||||||
AddNested(getVisualRepresentation?.Invoke(o));
|
AddNested(createDrawableRepresentation?.Invoke(o));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void AddNested(DrawableHitObject h)
|
protected override void AddNested(DrawableHitObject h)
|
||||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
|
|
||||||
internal readonly CatcherArea CatcherArea;
|
internal readonly CatcherArea CatcherArea;
|
||||||
|
|
||||||
public CatchPlayfield(BeatmapDifficulty difficulty, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> getVisualRepresentation)
|
public CatchPlayfield(BeatmapDifficulty difficulty, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> createDrawableRepresentation)
|
||||||
{
|
{
|
||||||
Container explodingFruitContainer;
|
Container explodingFruitContainer;
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
},
|
},
|
||||||
CatcherArea = new CatcherArea(difficulty)
|
CatcherArea = new CatcherArea(difficulty)
|
||||||
{
|
{
|
||||||
GetVisualRepresentation = getVisualRepresentation,
|
CreateDrawableRepresentation = createDrawableRepresentation,
|
||||||
ExplodingFruitTarget = explodingFruitContainer,
|
ExplodingFruitTarget = explodingFruitContainer,
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Origin = Anchor.TopLeft,
|
Origin = Anchor.TopLeft,
|
||||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
|
|
||||||
protected internal readonly Catcher MovableCatcher;
|
protected internal readonly Catcher MovableCatcher;
|
||||||
|
|
||||||
public Func<CatchHitObject, DrawableHitObject<CatchHitObject>> GetVisualRepresentation;
|
public Func<CatchHitObject, DrawableHitObject<CatchHitObject>> CreateDrawableRepresentation;
|
||||||
|
|
||||||
public Container ExplodingFruitTarget
|
public Container ExplodingFruitTarget
|
||||||
{
|
{
|
||||||
@ -65,7 +65,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
|
|
||||||
if (result.IsHit && fruit.CanBePlated)
|
if (result.IsHit && fruit.CanBePlated)
|
||||||
{
|
{
|
||||||
var caughtFruit = (DrawableCatchHitObject)GetVisualRepresentation?.Invoke(fruit.HitObject);
|
var caughtFruit = (DrawableCatchHitObject)CreateDrawableRepresentation?.Invoke(fruit.HitObject);
|
||||||
|
|
||||||
if (caughtFruit == null) return;
|
if (caughtFruit == null) return;
|
||||||
|
|
||||||
|
@ -34,11 +34,11 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
|
|
||||||
protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new CatchFramedReplayInputHandler(replay);
|
protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new CatchFramedReplayInputHandler(replay);
|
||||||
|
|
||||||
protected override Playfield CreatePlayfield() => new CatchPlayfield(Beatmap.BeatmapInfo.BaseDifficulty, GetVisualRepresentation);
|
protected override Playfield CreatePlayfield() => new CatchPlayfield(Beatmap.BeatmapInfo.BaseDifficulty, CreateDrawableRepresentation);
|
||||||
|
|
||||||
protected override PassThroughInputManager CreateInputManager() => new CatchInputManager(Ruleset.RulesetInfo);
|
protected override PassThroughInputManager CreateInputManager() => new CatchInputManager(Ruleset.RulesetInfo);
|
||||||
|
|
||||||
public override DrawableHitObject<CatchHitObject> GetVisualRepresentation(CatchHitObject h)
|
public override DrawableHitObject<CatchHitObject> CreateDrawableRepresentation(CatchHitObject h)
|
||||||
{
|
{
|
||||||
switch (h)
|
switch (h)
|
||||||
{
|
{
|
||||||
@ -47,9 +47,9 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
case Fruit fruit:
|
case Fruit fruit:
|
||||||
return new DrawableFruit(fruit);
|
return new DrawableFruit(fruit);
|
||||||
case JuiceStream stream:
|
case JuiceStream stream:
|
||||||
return new DrawableJuiceStream(stream, GetVisualRepresentation);
|
return new DrawableJuiceStream(stream, CreateDrawableRepresentation);
|
||||||
case BananaShower shower:
|
case BananaShower shower:
|
||||||
return new DrawableBananaShower(shower, GetVisualRepresentation);
|
return new DrawableBananaShower(shower, CreateDrawableRepresentation);
|
||||||
case TinyDroplet tiny:
|
case TinyDroplet tiny:
|
||||||
return new DrawableTinyDroplet(tiny);
|
return new DrawableTinyDroplet(tiny);
|
||||||
case Droplet droplet:
|
case Droplet droplet:
|
||||||
|
@ -101,7 +101,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
|
|
||||||
protected override PassThroughInputManager CreateInputManager() => new ManiaInputManager(Ruleset.RulesetInfo, Variant);
|
protected override PassThroughInputManager CreateInputManager() => new ManiaInputManager(Ruleset.RulesetInfo, Variant);
|
||||||
|
|
||||||
public override DrawableHitObject<ManiaHitObject> GetVisualRepresentation(ManiaHitObject h)
|
public override DrawableHitObject<ManiaHitObject> CreateDrawableRepresentation(ManiaHitObject h)
|
||||||
{
|
{
|
||||||
switch (h)
|
switch (h)
|
||||||
{
|
{
|
||||||
|
@ -32,7 +32,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
|
|
||||||
protected override PassThroughInputManager CreateInputManager() => new OsuInputManager(Ruleset.RulesetInfo);
|
protected override PassThroughInputManager CreateInputManager() => new OsuInputManager(Ruleset.RulesetInfo);
|
||||||
|
|
||||||
public override DrawableHitObject<OsuHitObject> GetVisualRepresentation(OsuHitObject h)
|
public override DrawableHitObject<OsuHitObject> CreateDrawableRepresentation(OsuHitObject h)
|
||||||
{
|
{
|
||||||
switch (h)
|
switch (h)
|
||||||
{
|
{
|
||||||
|
@ -85,7 +85,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
|
|
||||||
protected override Playfield CreatePlayfield() => new TaikoPlayfield(Beatmap.ControlPointInfo);
|
protected override Playfield CreatePlayfield() => new TaikoPlayfield(Beatmap.ControlPointInfo);
|
||||||
|
|
||||||
public override DrawableHitObject<TaikoHitObject> GetVisualRepresentation(TaikoHitObject h)
|
public override DrawableHitObject<TaikoHitObject> CreateDrawableRepresentation(TaikoHitObject h)
|
||||||
{
|
{
|
||||||
switch (h)
|
switch (h)
|
||||||
{
|
{
|
||||||
|
@ -73,7 +73,7 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
processor?.PostProcess();
|
processor?.PostProcess();
|
||||||
|
|
||||||
// Add visual representation
|
// Add visual representation
|
||||||
var drawableObject = drawableRuleset.GetVisualRepresentation(tObject);
|
var drawableObject = drawableRuleset.CreateDrawableRepresentation(tObject);
|
||||||
|
|
||||||
drawableRuleset.Playfield.Add(drawableObject);
|
drawableRuleset.Playfield.Add(drawableObject);
|
||||||
drawableRuleset.Playfield.PostProcess();
|
drawableRuleset.Playfield.PostProcess();
|
||||||
|
@ -161,7 +161,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
private void loadObjects()
|
private void loadObjects()
|
||||||
{
|
{
|
||||||
foreach (TObject h in Beatmap.HitObjects)
|
foreach (TObject h in Beatmap.HitObjects)
|
||||||
addRepresentation(h);
|
addHitObject(h);
|
||||||
|
|
||||||
Playfield.PostProcess();
|
Playfield.PostProcess();
|
||||||
|
|
||||||
@ -175,9 +175,9 @@ namespace osu.Game.Rulesets.UI
|
|||||||
/// Creates and adds the visual representation of a <see cref="TObject"/> to this <see cref="DrawableRuleset{TObject}"/>.
|
/// Creates and adds the visual representation of a <see cref="TObject"/> to this <see cref="DrawableRuleset{TObject}"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="hitObject">The <see cref="TObject"/> to add the visual representation for.</param>
|
/// <param name="hitObject">The <see cref="TObject"/> to add the visual representation for.</param>
|
||||||
private void addRepresentation(TObject hitObject)
|
private void addHitObject(TObject hitObject)
|
||||||
{
|
{
|
||||||
var drawableObject = GetVisualRepresentation(hitObject);
|
var drawableObject = CreateDrawableRepresentation(hitObject);
|
||||||
|
|
||||||
if (drawableObject == null)
|
if (drawableObject == null)
|
||||||
return;
|
return;
|
||||||
@ -209,7 +209,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="h">The HitObject to make drawable.</param>
|
/// <param name="h">The HitObject to make drawable.</param>
|
||||||
/// <returns>The DrawableHitObject.</returns>
|
/// <returns>The DrawableHitObject.</returns>
|
||||||
public abstract DrawableHitObject<TObject> GetVisualRepresentation(TObject h);
|
public abstract DrawableHitObject<TObject> CreateDrawableRepresentation(TObject h);
|
||||||
|
|
||||||
public void Attach(KeyCounterCollection keyCounter) =>
|
public void Attach(KeyCounterCollection keyCounter) =>
|
||||||
(KeyBindingInputManager as ICanAttachKeyCounter)?.Attach(keyCounter);
|
(KeyBindingInputManager as ICanAttachKeyCounter)?.Attach(keyCounter);
|
||||||
|
Loading…
Reference in New Issue
Block a user