mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:17:23 +08:00
Rename to HitObjectUsageEventBuffer
This commit is contained in:
parent
bfc0205e9b
commit
633f841a0f
@ -19,7 +19,7 @@ namespace osu.Game.Tests.Editing
|
||||
private TestPlayfield playfield1;
|
||||
private TestPlayfield playfield2;
|
||||
private TestDrawable intermediateDrawable;
|
||||
private HitObjectContainerEventQueue eventQueue;
|
||||
private HitObjectUsageEventBuffer eventBuffer;
|
||||
|
||||
private HitObject beganUsage;
|
||||
private HitObject finishedUsage;
|
||||
@ -30,27 +30,27 @@ namespace osu.Game.Tests.Editing
|
||||
{
|
||||
reset();
|
||||
|
||||
if (eventQueue != null)
|
||||
if (eventBuffer != null)
|
||||
{
|
||||
eventQueue.HitObjectUsageBegan -= onHitObjectUsageBegan;
|
||||
eventQueue.HitObjectUsageFinished -= onHitObjectUsageFinished;
|
||||
eventQueue.HitObjectUsageTransferred -= onHitObjectUsageTransferred;
|
||||
eventBuffer.HitObjectUsageBegan -= onHitObjectUsageBegan;
|
||||
eventBuffer.HitObjectUsageFinished -= onHitObjectUsageFinished;
|
||||
eventBuffer.HitObjectUsageTransferred -= onHitObjectUsageTransferred;
|
||||
}
|
||||
|
||||
var topPlayfield = new TestPlayfield();
|
||||
topPlayfield.AddNested(playfield1 = new TestPlayfield());
|
||||
topPlayfield.AddNested(playfield2 = new TestPlayfield());
|
||||
|
||||
eventQueue = new HitObjectContainerEventQueue(topPlayfield);
|
||||
eventQueue.HitObjectUsageBegan += onHitObjectUsageBegan;
|
||||
eventQueue.HitObjectUsageFinished += onHitObjectUsageFinished;
|
||||
eventQueue.HitObjectUsageTransferred += onHitObjectUsageTransferred;
|
||||
eventBuffer = new HitObjectUsageEventBuffer(topPlayfield);
|
||||
eventBuffer.HitObjectUsageBegan += onHitObjectUsageBegan;
|
||||
eventBuffer.HitObjectUsageFinished += onHitObjectUsageFinished;
|
||||
eventBuffer.HitObjectUsageTransferred += onHitObjectUsageTransferred;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
topPlayfield,
|
||||
intermediateDrawable = new TestDrawable(),
|
||||
eventQueue
|
||||
eventBuffer
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -46,7 +46,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
foreach (var obj in Composer.HitObjects)
|
||||
AddBlueprintFor(obj.HitObject);
|
||||
|
||||
var eventQueue = new HitObjectContainerEventQueue(Composer.Playfield);
|
||||
var eventQueue = new HitObjectUsageEventBuffer(Composer.Playfield);
|
||||
eventQueue.HitObjectUsageBegan += AddBlueprintFor;
|
||||
eventQueue.HitObjectUsageFinished += RemoveBlueprintFor;
|
||||
eventQueue.HitObjectUsageTransferred += TransferBlueprintFor;
|
||||
|
@ -13,9 +13,9 @@ using osu.Game.Rulesets.UI;
|
||||
namespace osu.Game.Screens.Edit.Compose
|
||||
{
|
||||
/// <summary>
|
||||
/// A queue which processes events from the many <see cref="HitObjectContainer"/>s in a nested <see cref="Playfield"/> hierarchy.
|
||||
/// Buffers events from the many <see cref="HitObjectContainer"/>s in a nested <see cref="Playfield"/> hierarchy.
|
||||
/// </summary>
|
||||
internal class HitObjectContainerEventQueue : Component
|
||||
internal class HitObjectUsageEventBuffer : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Invoked when a <see cref="HitObject"/> becomes used by a <see cref="DrawableHitObject"/>.
|
||||
@ -41,10 +41,10 @@ namespace osu.Game.Screens.Edit.Compose
|
||||
private readonly Playfield playfield;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="HitObjectContainerEventQueue"/>.
|
||||
/// Creates a new <see cref="HitObjectUsageEventBuffer"/>.
|
||||
/// </summary>
|
||||
/// <param name="playfield">The most top-level <see cref="Playfield"/>.</param>
|
||||
public HitObjectContainerEventQueue([NotNull] Playfield playfield)
|
||||
public HitObjectUsageEventBuffer([NotNull] Playfield playfield)
|
||||
{
|
||||
this.playfield = playfield;
|
||||
|
||||
@ -70,7 +70,7 @@ namespace osu.Game.Screens.Edit.Compose
|
||||
{
|
||||
// This exists as a safeguard to ensure that the sequence: { Began -> Finished }, where { ... } indicates a sequence within a single frame, does not trigger any events.
|
||||
// This is unlikely to occur in practice as it requires the usage to finish immediately after the HitObjectContainer updates hitobject lifetimes,
|
||||
// however, an Editor action scheduled somewhere between the lifetime update and this event queue's own Update() could cause this.
|
||||
// however, an Editor action scheduled somewhere between the lifetime update and this buffer's own Update() could cause this.
|
||||
case (EventType.Began, EventType.Finished):
|
||||
pendingEvents.Remove(hitObject);
|
||||
break;
|
Loading…
Reference in New Issue
Block a user