Resource converter module interface #1256
Open
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.
Development for #1255
ConverterFields.cs gives full set of interfaces for ModuleResourceConverter, allowing the scripts not only to turn converter on and off, but also access its performance data. Besides data available to the player in the right-click menu, it also allows to read some converter parameters set in part's config file (including conversion recipe) as well as the actual current resource consumption and production.
ConverterValue part struct gives both a way to address specific converter modules and an option to address all of them by calling the same suffixes on it (for single-module case there won't be difference).
Such double-layer system can be useful for handling other cases, like potentially multiple science modules on the same part.