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

Use string_id for update_mapgen and nested_mapgen #51800

Merged
merged 1 commit into from
Sep 23, 2021

Conversation

jbytheway
Copy link
Contributor

@jbytheway jbytheway commented Sep 22, 2021

Summary

None

Purpose of change

Type safety and code clarity.

Update mapgen and nested mapgen both use ids. These ids were previously just using strings

Describe the solution

Switch to a dedicated string_id type.

This required adding an actual type for the string_id to point to in each case, wrapping the collection of mapgen_function_json objects.

Describe alternatives you've considered

Doing the same for mapgen at the same time, but that's complicated because they're more or less oter_ids, except not exactly.

Testing

Unit tests are running as I PR this.

Additional context

These ids were previously just using strings; better to use a dedicated
string_id type.

This required adding an actual type for the string_id to point to in
each case, wrapping the collection of mapgen_function_json objects.
@actual-nh actual-nh added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Map / Mapgen Overmap, Mapgen, Map extras, Map display labels Sep 22, 2021
@ZhilkinSerg ZhilkinSerg merged commit d28f181 into CleverRaven:master Sep 23, 2021
@jbytheway jbytheway deleted the nested_mapgen_id branch September 24, 2021 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Map / Mapgen Overmap, Mapgen, Map extras, Map display
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants