Skip to content

Rework EngineContainer to use generics#414

Open
Supersonicboss1 wants to merge 1 commit into
YARC-Official:masterfrom
Supersonicboss1:enginecontainer-rework
Open

Rework EngineContainer to use generics#414
Supersonicboss1 wants to merge 1 commit into
YARC-Official:masterfrom
Supersonicboss1:enginecontainer-rework

Conversation

@Supersonicboss1

@Supersonicboss1 Supersonicboss1 commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

We also store an InstrumentDifficulty<TNoteType> now, instead of separate Instrument and Difficulty members (though we still expose these through an auto-property for convenience). This has the benefit of GetUnisonSections using the note chart the engine uses, instead of the original note chart, preserving any modifications made by modifiers.

We pass in all three parameters the engine requires (note, params, stats) instead of a note/engine pair because it allows us to use anything in BaseEngine.Generic.cs, including a bunch of events (e.g. OnNoteHit) that we would otherwise not be able to use without manual type checks. This saves us a bunch of boilerplate in event subscriptions, for example (though we still need some, e.g. because of OnOverhit/OnOverstrum, and vocals-specific events).

Unfortunately a fair bit of boilerplate had to be added to ReplayAnalyzer since it can't really use generics easily.

Requires YARC-Official/YARG#1560.

@wyrdough wyrdough left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gonna need to look at this in context and do a bit of testing, but at first blush this looks good to me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants