Update states and allowed regiment cultures #544
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.
States were never registered to the country instance. Also they stored their owner separately despite it being linked to the capital owner. This has changed. In the gamestate update and State constructor, the state adds itself from the country instance (and/or removes from the old). The owner is no longer stored as a field, instead it is retrieved via the capital province.
Countries can recruit regiments. Regiments can have cultural limitations (all cultures, all accepted or primary only). The country stores a field containing the most permissive cultural limitation based on the unlocked unit types. This was never updates.
Now it is updated whenever a regiment type is locked or unlocked.
The console output was flooded by messages saying that the buildings registry was locked. This caused Godot to error due to being flooded. The IdentifierRegistry has a constructor overload that takes a bool indicating whether or not to log upon locking. For province buildings, this is now set to not log when locking.
In the InstanceManager, the order of execution when loading a bookmark is changed:
First
map_instance.initialise_for_new_game(*this);
and thencountry_instance_manager.update_gamestate(*this);
instead of the other way around. This ensures that the states, provinces and pops have their state updated before we aggregate it in the countries. Note it now mimics the order inInstanceManager::update_gamestate()
.