-
Notifications
You must be signed in to change notification settings - Fork 8
Move country parsing functionality to CountryParser #640
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,11 +34,9 @@ namespace OpenVic { | |
| unit_names_map_t PROPERTY(unit_names); | ||
| const bool PROPERTY_CUSTOM_PREFIX(dynamic_tag, is); | ||
Spartan322 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| government_colour_map_t PROPERTY(alternative_colours); | ||
| colour_t PROPERTY(primary_unit_colour); | ||
| colour_t PROPERTY(secondary_unit_colour); | ||
| colour_t PROPERTY(tertiary_unit_colour); | ||
| // Unit colours not const due to being added after construction | ||
|
|
||
| colour_t PROPERTY_RW(primary_unit_colour); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why use property here?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No because PROPERTY only generate a const getter, (and even then colour returns by value anyway) the unit colours need to be assigned. |
||
| colour_t PROPERTY_RW(secondary_unit_colour); | ||
| colour_t PROPERTY_RW(tertiary_unit_colour); | ||
|
|
||
| public: | ||
| CountryDefinition( | ||
|
|
@@ -56,23 +54,14 @@ namespace OpenVic { | |
| private: | ||
| IdentifierRegistry<CountryDefinition> IDENTIFIER_REGISTRY(country_definition); | ||
|
|
||
| NodeTools::node_callback_t load_country_party( | ||
| PoliticsManager const& politics_manager, IdentifierRegistry<CountryParty>& country_parties | ||
| ) const; | ||
|
|
||
| public: | ||
| IDENTIFIER_REGISTRY_NON_CONST_ACCESSORS(country_definition); | ||
|
|
||
| bool add_country( | ||
| std::string_view identifier, colour_t colour, GraphicalCultureType const* graphical_culture, | ||
| IdentifierRegistry<CountryParty>&& parties, CountryDefinition::unit_names_map_t&& unit_names, bool dynamic_tag, | ||
| CountryDefinition::government_colour_map_t&& alternative_colours | ||
| ); | ||
|
|
||
| bool load_country_colours(ast::NodeCPtr root); | ||
|
|
||
| bool load_countries(DefinitionManager const& definition_manager, Dataloader const& dataloader, ast::NodeCPtr root); | ||
| bool load_country_data_file( | ||
| DefinitionManager const& definition_manager, std::string_view name, bool is_dynamic, ast::NodeCPtr root | ||
| ); | ||
| }; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to move the CountryDefinitionManager out.
Either move it to a separate file or split it between the DefinitionManager and the CountryParser entirely (my preference).