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 is not meant to be merged right away.
I was working on something that eventually asked the question "is unit X available to this civilization?"
So I figured I will push this small change separately and not bloat the thing I am working on.
Now, I wanted to ask what you think about the implementation @TomWerner @esbudylin @WildWeazel (don't feel obliged to comment or anything, just wanted to make sure that if you want to, you don't miss the PR)
I went with unavailableTo instead of "availableTo" because most of the units are available to all, so, having a ~30 line array in each Prototype in the json seemed a bit too much. The most space in the json file is taken up by units like Kings, and then the unique units and units that can only be produced by a wonder (e.x. Ancient Cavalry).
What do you think about not including the availability at all for these units, and rely on uniqueness and if they can be produced by a wonder? I don't know what the code would look like, but if you agree on this, I can at least try to make it work and have a nice API in place.
This will reduce the size and just the eyesore 30 civ arrays, but it will probably mean that it won't be as clear to someone looking at it to figure out what's going on.
Also, I didn't change the standalone json because I wanted to decide on a format first, and then there is Yegor's PR , which when merged will eliminate the need for that second json.