From 112de0ac9c7ce26bd75d06e4cd3bc91adee716e3 Mon Sep 17 00:00:00 2001 From: Spartan322 Date: Sun, 23 Apr 2023 23:36:42 -0400 Subject: Support features up to clang-format 14 Add .editorconfig Update C++ files within `extension/src` to follow .clang-format --- extension/src/openvic2/map/Map.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'extension/src/openvic2/map/Map.cpp') diff --git a/extension/src/openvic2/map/Map.cpp b/extension/src/openvic2/map/Map.cpp index 1f44c43..f920ccc 100644 --- a/extension/src/openvic2/map/Map.cpp +++ b/extension/src/openvic2/map/Map.cpp @@ -8,7 +8,9 @@ using namespace OpenVic2; Mapmode::Mapmode(index_t new_index, std::string const& new_identifier, colour_func_t new_colour_func) - : HasIdentifier{ new_identifier }, index{ new_index }, colour_func{ new_colour_func } { + : HasIdentifier { new_identifier }, + index { new_index }, + colour_func { new_colour_func } { assert(colour_func != nullptr); } @@ -20,7 +22,9 @@ colour_t Mapmode::get_colour(Map const& map, Province const& province) const { return colour_func ? colour_func(map, province) : NULL_COLOUR; } -Map::Map() : provinces{ "provinces" }, regions{ "regions" }, mapmodes{ "mapmodes" } {} +Map::Map() : provinces { "provinces" }, + regions { "regions" }, + mapmodes { "mapmodes" } {} return_t Map::add_province(std::string const& identifier, colour_t colour) { if (provinces.get_item_count() >= MAX_INDEX) { @@ -35,7 +39,7 @@ return_t Map::add_province(std::string const& identifier, colour_t colour) { Logger::error("Invalid province colour: ", Province::colour_to_hex_string(colour)); return FAILURE; } - Province new_province{ static_cast(provinces.get_item_count() + 1), identifier, colour }; + Province new_province { static_cast(provinces.get_item_count() + 1), identifier, colour }; const index_t index = get_index_from_colour(colour); if (index != NULL_INDEX) { Logger::error("Duplicate province colours: ", get_province_by_index(index)->to_string(), " and ", new_province.to_string()); @@ -78,7 +82,7 @@ return_t Map::add_region(std::string const& identifier, std::vector Logger::error("Invalid region identifier - empty!"); return FAILURE; } - Region new_region{ identifier }; + Region new_region { identifier }; return_t ret = SUCCESS; for (std::string const& province_identifier : province_identifiers) { Province* province = get_province_by_identifier(province_identifier); -- cgit v1.2.3-56-ga3b1