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

Allow array of identifiers in id node of objects loaded by generic factory #39366

Merged
merged 5 commits into from
Apr 11, 2020

Conversation

ZhilkinSerg
Copy link
Contributor

@ZhilkinSerg ZhilkinSerg commented Apr 8, 2020

Summary

SUMMARY: None

Purpose of change

  • Clean up some code of generic factory (make node naming consistent across various object types).
  • Allow array of identifiers in id node of objects loaded by generic factory (can be useful to reduce cluttering of overmap terrain definitions by combining entries with same settings). This will allow to replace the following:
  {
    "id": "urban_4_6",
    "type": "overmap_terrain",
    "name": "house",
    "copy-from": "generic_city_building_no_sidewalk",
    "color": "light_green",
    "see_cost": 10
  },
  {
    "id": "urban_4_7",
    "type": "overmap_terrain",
    "name": "house",
    "copy-from": "generic_city_building_no_sidewalk",
    "color": "light_green",
    "see_cost": 10
  },
  {
    "id": "urban_4_8",
    "type": "overmap_terrain",
    "name": "house",
    "copy-from": "generic_city_building_no_sidewalk",
    "color": "light_green",
    "see_cost": 10
  }

with the following:

  {
    "id": [ "urban_4_6", "urban_4_7", "urban_4_8" ] ,
    "type": "overmap_terrain",
    "name": "house",
    "copy-from": "generic_city_building_no_sidewalk",
    "color": "light_green",
    "see_cost": 10
  },

Describe the solution

See commit messages.

Testing

Make sure it compiles, tests are running cleanly and there are no loading errors.

Additional context

I will add JSON changes for overmap terrains in follow-up PR(s).

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants