Refactor InputDisplayGenerator + LogEntryGenerator + ControllerDefinition #3782
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR supersedes / expands #3742.
This also partially (fixes) #3779 (the exception is fixed and the movie imports fine, but the logkey is missing FDS controls and so the movie may misbehave when editing it).
The main goals here are to improve performance (e.g. for the movie importers) by improving caching, simplify code and make the structure better and clearer.
Now, the Bk2LogEntryGenerator and Bk2InputDisplayGenerator classes are entirely static and just take an
IController
as input. They now rely on theIController::Definition
sMnemonicCache
to be performant, whereas such a cache was previously built by the classes themselves.I'm not entirely sure about this cache being on
ControllerDefinition
, but I feel like it does make sense in the current code structure.The fact that this cache needs to be manually built is kinda ugly. The best solution I can see for that would be to move the
Bk2MnemonicLookup
to a place accessable byControllerDefinition
and build the mnemonic cache onMakeImmutable
(which then needs an additionalsystemId
arg).Oh, I also removed the hacky
SetMovieController
function that was used for initialdefault.tasproj
saving, didn't seem to be necessary?this will 100% cause bugs later onCheck if completed: