Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor item components to be stored as a map #62498

Merged
merged 1 commit into from
Mar 10, 2023

Conversation

mqrause
Copy link
Contributor

@mqrause mqrause commented Nov 30, 2022

Summary

Infrastructure "Refactor item components to be stored as a map"

Purpose of change

Assigning components to crafting results from a list is pretty sketchy, when it should get split up to multiple result items. I need it to be less sketchy for #60885.

Describe the solution

Turn components into a map and make a wrapper class around it for some easier handling. Then adjust all the code to work again. Also replace a hacky solution in the invlet test with a proper one.

This adds a fairly prevalent error message when components can't be evenly distributed to resulting items when crafting a recipe. I do believe that needs to be fixed one way or another, but if it's too much of an annoyance, the messages can be removed and some automated way to identify such problematic recipes can be devised.

Describe alternatives you've considered

Go even further with the refactor, but this wasn't planned for the charge removal project so I don't want to spend more time on it than necessary.

Testing

Not much yet. Game loads old saves, can disassemble old items, can craft new items, tests pass locally.
Also indirectly tested with #60885 and #63704.

Additional context

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Info / User Interface Game - player communication, menus, etc. Melee Melee weapons, tactics, techniques, reach attack Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Nov 30, 2022
@mqrause mqrause force-pushed the component_refactor branch 2 times, most recently from 4be86c2 to e2d2f81 Compare November 30, 2022 22:24
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Dec 1, 2022
@mqrause mqrause force-pushed the component_refactor branch from e2d2f81 to e5d8864 Compare December 1, 2022 10:03
@misterprimus
Copy link
Contributor

Does it avoid adding consumables like welding rods and bone glue to the components list after crafting to avoid recovering items that should be unrecoverable? #51172

@mqrause
Copy link
Contributor Author

mqrause commented Feb 10, 2023

Not this one, but I added something to do that in #60885.

Actually no fixes for that included anywhere for now.

@mqrause mqrause marked this pull request as draft March 3, 2023 09:25
@mqrause mqrause marked this pull request as ready for review March 9, 2023 01:38
@mqrause mqrause force-pushed the component_refactor branch from e5d8864 to 885743d Compare March 9, 2023 14:56
@dseguin dseguin merged commit fe5350e into CleverRaven:master Mar 10, 2023
@mqrause mqrause deleted the component_refactor branch March 10, 2023 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Code: Tests Measurement, self-control, statistics, balancing. Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions Melee Melee weapons, tactics, techniques, reach attack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants