From 91ed4377c2d582e7ab6316a092d95cb1a71fad26 Mon Sep 17 00:00:00 2001 From: klingbolt Date: Mon, 30 Oct 2023 20:09:24 -0400 Subject: [PATCH] Adds a comma inbetween the flags when writing to xml --- .../cpp_templates/multiflagvalue.cpp | 11 +- .../src/attribute/festival_filter_gen.cpp | 23 ++- .../src/attribute/map_type_filter_gen.cpp | 57 ++++--- .../src/attribute/mount_filter_gen.cpp | 29 ++-- .../src/attribute/profession_filter_gen.cpp | 27 ++-- .../attribute/specialization_filter_gen.cpp | 153 +++++++++--------- .../src/attribute/species_filter_gen.cpp | 19 ++- 7 files changed, 184 insertions(+), 135 deletions(-) diff --git a/xml_converter/generators/cpp_templates/multiflagvalue.cpp b/xml_converter/generators/cpp_templates/multiflagvalue.cpp index 11fe543a..b071fc64 100644 --- a/xml_converter/generators/cpp_templates/multiflagvalue.cpp +++ b/xml_converter/generators/cpp_templates/multiflagvalue.cpp @@ -44,12 +44,19 @@ using namespace std; } string stringify_{{attribute_name}}({{class_name}} attribute_value) { - string output = ""; + vector flag_values; {% for n, attribute_variable in enumerate(attribute_variables)%} if (attribute_value.{{attribute_variable.attribute_name}} == true) { - output = output + "{{attribute_variable.xml_fields[0]}}"; + flag_values.push_back("{{attribute_variable.xml_fields[0]}}"); } {% endfor %} + string output = ""; + for (size_t i = 0; i < flag_values.size(); ++i) { + output += flag_values[i]; + if (i < flag_values.size() - 1){ + output += ","; + } + } return output; } diff --git a/xml_converter/src/attribute/festival_filter_gen.cpp b/xml_converter/src/attribute/festival_filter_gen.cpp index c7f86ea8..df96db76 100644 --- a/xml_converter/src/attribute/festival_filter_gen.cpp +++ b/xml_converter/src/attribute/festival_filter_gen.cpp @@ -59,27 +59,34 @@ FestivalFilter parse_festival_filter(rapidxml::xml_attribute<>* input, vector flag_values; if (attribute_value.dragonbash == true) { - output = output + "dragonbash"; + flag_values.push_back("dragonbash"); } if (attribute_value.festival_of_the_four_winds == true) { - output = output + "festivalofthefourwinds"; + flag_values.push_back("festivalofthefourwinds"); } if (attribute_value.halloween == true) { - output = output + "halloween"; + flag_values.push_back("halloween"); } if (attribute_value.lunar_new_year == true) { - output = output + "lunarnewyear"; + flag_values.push_back("lunarnewyear"); } if (attribute_value.super_adventure_festival == true) { - output = output + "superadventurefestival"; + flag_values.push_back("superadventurefestival"); } if (attribute_value.wintersday == true) { - output = output + "wintersday"; + flag_values.push_back("wintersday"); } if (attribute_value.none == true) { - output = output + "none"; + flag_values.push_back("none"); + } + string output = ""; + for (size_t i = 0; i < flag_values.size(); ++i) { + output += flag_values[i]; + if (i < flag_values.size() - 1){ + output += ","; + } } return output; } diff --git a/xml_converter/src/attribute/map_type_filter_gen.cpp b/xml_converter/src/attribute/map_type_filter_gen.cpp index 6a847d8a..3eaa307b 100644 --- a/xml_converter/src/attribute/map_type_filter_gen.cpp +++ b/xml_converter/src/attribute/map_type_filter_gen.cpp @@ -124,78 +124,85 @@ MapTypeFilter parse_map_type_filter(rapidxml::xml_attribute<>* input, vector flag_values; if (attribute_value.unknown_map == true) { - output = output + "unknown"; + flag_values.push_back("unknown"); } if (attribute_value.redirect_map == true) { - output = output + "redirect"; + flag_values.push_back("redirect"); } if (attribute_value.character_create_map == true) { - output = output + "charactercreate"; + flag_values.push_back("charactercreate"); } if (attribute_value.pvp_map == true) { - output = output + "pvp"; + flag_values.push_back("pvp"); } if (attribute_value.gvg_map == true) { - output = output + "gvg"; + flag_values.push_back("gvg"); } if (attribute_value.instance_map == true) { - output = output + "instance"; + flag_values.push_back("instance"); } if (attribute_value.public_map == true) { - output = output + "public"; + flag_values.push_back("public"); } if (attribute_value.tournament_map == true) { - output = output + "tournament"; + flag_values.push_back("tournament"); } if (attribute_value.tutorial_map == true) { - output = output + "tutorial"; + flag_values.push_back("tutorial"); } if (attribute_value.user_tournament_map == true) { - output = output + "usertournament"; + flag_values.push_back("usertournament"); } if (attribute_value.center_map == true) { - output = output + "center"; + flag_values.push_back("center"); } if (attribute_value.eternal_battlegrounds_map == true) { - output = output + "eternalbattlegrounds"; + flag_values.push_back("eternalbattlegrounds"); } if (attribute_value.bluehome_map == true) { - output = output + "bluehome"; + flag_values.push_back("bluehome"); } if (attribute_value.blue_borderlands_map == true) { - output = output + "blueborderlands"; + flag_values.push_back("blueborderlands"); } if (attribute_value.green_home_map == true) { - output = output + "greenhome"; + flag_values.push_back("greenhome"); } if (attribute_value.green_borderlands_map == true) { - output = output + "greenborderlands"; + flag_values.push_back("greenborderlands"); } if (attribute_value.red_home_map == true) { - output = output + "redhome"; + flag_values.push_back("redhome"); } if (attribute_value.red_borderlands_map == true) { - output = output + "redborderlands"; + flag_values.push_back("redborderlands"); } if (attribute_value.fortunes_vale_map == true) { - output = output + "fortunesvale"; + flag_values.push_back("fortunesvale"); } if (attribute_value.jump_puzzle_map == true) { - output = output + "jumppuzzle"; + flag_values.push_back("jumppuzzle"); } if (attribute_value.obsidian_sanctum_map == true) { - output = output + "obsidiansanctum"; + flag_values.push_back("obsidiansanctum"); } if (attribute_value.edge_of_the_mists_map == true) { - output = output + "edgeofthemists"; + flag_values.push_back("edgeofthemists"); } if (attribute_value.public_mini_map == true) { - output = output + "publicmini"; + flag_values.push_back("publicmini"); } if (attribute_value.wvw_lounge_map == true) { - output = output + "wvwlounge"; + flag_values.push_back("wvwlounge"); + } + string output = ""; + for (size_t i = 0; i < flag_values.size(); ++i) { + output += flag_values[i]; + if (i < flag_values.size() - 1){ + output += ","; + } } return output; } diff --git a/xml_converter/src/attribute/mount_filter_gen.cpp b/xml_converter/src/attribute/mount_filter_gen.cpp index bd40f601..34019c09 100644 --- a/xml_converter/src/attribute/mount_filter_gen.cpp +++ b/xml_converter/src/attribute/mount_filter_gen.cpp @@ -68,36 +68,43 @@ MountFilter parse_mount_filter(rapidxml::xml_attribute<>* input, vector flag_values; if (attribute_value.raptor == true) { - output = output + "raptor"; + flag_values.push_back("raptor"); } if (attribute_value.springer == true) { - output = output + "springer"; + flag_values.push_back("springer"); } if (attribute_value.skimmer == true) { - output = output + "skimmer"; + flag_values.push_back("skimmer"); } if (attribute_value.jackal == true) { - output = output + "jackal"; + flag_values.push_back("jackal"); } if (attribute_value.griffon == true) { - output = output + "griffon"; + flag_values.push_back("griffon"); } if (attribute_value.roller_beetle == true) { - output = output + "rollerbeetle"; + flag_values.push_back("rollerbeetle"); } if (attribute_value.warclaw == true) { - output = output + "warclaw"; + flag_values.push_back("warclaw"); } if (attribute_value.skyscale == true) { - output = output + "skyscale"; + flag_values.push_back("skyscale"); } if (attribute_value.skiff == true) { - output = output + "skiff"; + flag_values.push_back("skiff"); } if (attribute_value.seige_turtle == true) { - output = output + "seigeturtle"; + flag_values.push_back("seigeturtle"); + } + string output = ""; + for (size_t i = 0; i < flag_values.size(); ++i) { + output += flag_values[i]; + if (i < flag_values.size() - 1){ + output += ","; + } } return output; } diff --git a/xml_converter/src/attribute/profession_filter_gen.cpp b/xml_converter/src/attribute/profession_filter_gen.cpp index 61e13e2a..2a3b3829 100644 --- a/xml_converter/src/attribute/profession_filter_gen.cpp +++ b/xml_converter/src/attribute/profession_filter_gen.cpp @@ -64,33 +64,40 @@ ProfessionFilter parse_profession_filter(rapidxml::xml_attribute<>* input, vecto } string stringify_profession_filter(ProfessionFilter attribute_value) { - string output = ""; + vector flag_values; if (attribute_value.guardian == true) { - output = output + "guardian"; + flag_values.push_back("guardian"); } if (attribute_value.warrior == true) { - output = output + "warrior"; + flag_values.push_back("warrior"); } if (attribute_value.engineer == true) { - output = output + "engineer"; + flag_values.push_back("engineer"); } if (attribute_value.ranger == true) { - output = output + "ranger"; + flag_values.push_back("ranger"); } if (attribute_value.thief == true) { - output = output + "thief"; + flag_values.push_back("thief"); } if (attribute_value.elementalist == true) { - output = output + "elementalist"; + flag_values.push_back("elementalist"); } if (attribute_value.mesmer == true) { - output = output + "mesmer"; + flag_values.push_back("mesmer"); } if (attribute_value.necromancer == true) { - output = output + "necromancer"; + flag_values.push_back("necromancer"); } if (attribute_value.revenant == true) { - output = output + "revenant"; + flag_values.push_back("revenant"); + } + string output = ""; + for (size_t i = 0; i < flag_values.size(); ++i) { + output += flag_values[i]; + if (i < flag_values.size() - 1){ + output += ","; + } } return output; } diff --git a/xml_converter/src/attribute/specialization_filter_gen.cpp b/xml_converter/src/attribute/specialization_filter_gen.cpp index 4292fd6b..941d898f 100644 --- a/xml_converter/src/attribute/specialization_filter_gen.cpp +++ b/xml_converter/src/attribute/specialization_filter_gen.cpp @@ -397,222 +397,229 @@ SpecializationFilter parse_specialization_filter(rapidxml::xml_attribute<>* inpu } string stringify_specialization_filter(SpecializationFilter attribute_value) { - string output = ""; + vector flag_values; if (attribute_value.elementalist_tempest == true) { - output = output + "48"; + flag_values.push_back("48"); } if (attribute_value.engineer_scrapper == true) { - output = output + "43"; + flag_values.push_back("43"); } if (attribute_value.guardian_dragonhunter == true) { - output = output + "27"; + flag_values.push_back("27"); } if (attribute_value.mesmer_chronomancer == true) { - output = output + "40"; + flag_values.push_back("40"); } if (attribute_value.necromancer_reaper == true) { - output = output + "34"; + flag_values.push_back("34"); } if (attribute_value.ranger_druid == true) { - output = output + "5"; + flag_values.push_back("5"); } if (attribute_value.revenant_herald == true) { - output = output + "52"; + flag_values.push_back("52"); } if (attribute_value.thief_daredevil == true) { - output = output + "7"; + flag_values.push_back("7"); } if (attribute_value.warrior_berserker == true) { - output = output + "18"; + flag_values.push_back("18"); } if (attribute_value.elementalist_weaver == true) { - output = output + "56"; + flag_values.push_back("56"); } if (attribute_value.engineer_holosmith == true) { - output = output + "57"; + flag_values.push_back("57"); } if (attribute_value.guardian_firebrand == true) { - output = output + "62"; + flag_values.push_back("62"); } if (attribute_value.mesmer_mirage == true) { - output = output + "59"; + flag_values.push_back("59"); } if (attribute_value.necromancer_scourge == true) { - output = output + "60"; + flag_values.push_back("60"); } if (attribute_value.ranger_soulbeast == true) { - output = output + "55"; + flag_values.push_back("55"); } if (attribute_value.revenant_renegade == true) { - output = output + "63"; + flag_values.push_back("63"); } if (attribute_value.thief_deadeye == true) { - output = output + "58"; + flag_values.push_back("58"); } if (attribute_value.warrior_spellbreaker == true) { - output = output + "61"; + flag_values.push_back("61"); } if (attribute_value.elementalist_catalyst == true) { - output = output + "67"; + flag_values.push_back("67"); } if (attribute_value.engineer_mechanist == true) { - output = output + "70"; + flag_values.push_back("70"); } if (attribute_value.guardian_willbender == true) { - output = output + "65"; + flag_values.push_back("65"); } if (attribute_value.mesmer_virtuoso == true) { - output = output + "66"; + flag_values.push_back("66"); } if (attribute_value.necromancer_harbinger == true) { - output = output + "64"; + flag_values.push_back("64"); } if (attribute_value.ranger_untamed == true) { - output = output + "72"; + flag_values.push_back("72"); } if (attribute_value.revenant_vindicator == true) { - output = output + "69"; + flag_values.push_back("69"); } if (attribute_value.thief_specter == true) { - output = output + "71"; + flag_values.push_back("71"); } if (attribute_value.warrior_bladesworn == true) { - output = output + "68"; + flag_values.push_back("68"); } if (attribute_value.elementalist_air == true) { - output = output + "41"; + flag_values.push_back("41"); } if (attribute_value.elementalist_arcane == true) { - output = output + "37"; + flag_values.push_back("37"); } if (attribute_value.elementalist_earth == true) { - output = output + "26"; + flag_values.push_back("26"); } if (attribute_value.elementalist_fire == true) { - output = output + "31"; + flag_values.push_back("31"); } if (attribute_value.elementalist_water == true) { - output = output + "17"; + flag_values.push_back("17"); } if (attribute_value.engineer_alchemy == true) { - output = output + "29"; + flag_values.push_back("29"); } if (attribute_value.engineer_explosives == true) { - output = output + "6"; + flag_values.push_back("6"); } if (attribute_value.engineer_firearms == true) { - output = output + "38"; + flag_values.push_back("38"); } if (attribute_value.engineer_inventions == true) { - output = output + "47"; + flag_values.push_back("47"); } if (attribute_value.engineer_tools == true) { - output = output + "21"; + flag_values.push_back("21"); } if (attribute_value.guardian_honor == true) { - output = output + "49"; + flag_values.push_back("49"); } if (attribute_value.guardian_radiance == true) { - output = output + "16"; + flag_values.push_back("16"); } if (attribute_value.guardian_valor == true) { - output = output + "13"; + flag_values.push_back("13"); } if (attribute_value.guardian_virtues == true) { - output = output + "46"; + flag_values.push_back("46"); } if (attribute_value.guardian_zeal == true) { - output = output + "42"; + flag_values.push_back("42"); } if (attribute_value.mesmer_chaos == true) { - output = output + "45"; + flag_values.push_back("45"); } if (attribute_value.mesmer_domination == true) { - output = output + "10"; + flag_values.push_back("10"); } if (attribute_value.mesmer_dueling == true) { - output = output + "1"; + flag_values.push_back("1"); } if (attribute_value.mesmer_illusions == true) { - output = output + "24"; + flag_values.push_back("24"); } if (attribute_value.mesmer_inspiration == true) { - output = output + "23"; + flag_values.push_back("23"); } if (attribute_value.necromancer_blood_magic == true) { - output = output + "19"; + flag_values.push_back("19"); } if (attribute_value.necromancer_curses == true) { - output = output + "39"; + flag_values.push_back("39"); } if (attribute_value.necromancer_death_magic == true) { - output = output + "2"; + flag_values.push_back("2"); } if (attribute_value.necromancer_soul_reaping == true) { - output = output + "50"; + flag_values.push_back("50"); } if (attribute_value.necromancer_spite == true) { - output = output + "53"; + flag_values.push_back("53"); } if (attribute_value.ranger_beastmastery == true) { - output = output + "32"; + flag_values.push_back("32"); } if (attribute_value.ranger_marksmanship == true) { - output = output + "8"; + flag_values.push_back("8"); } if (attribute_value.ranger_nature_magic == true) { - output = output + "25"; + flag_values.push_back("25"); } if (attribute_value.ranger_skirmishing == true) { - output = output + "30"; + flag_values.push_back("30"); } if (attribute_value.ranger_wilderness_survival == true) { - output = output + "33"; + flag_values.push_back("33"); } if (attribute_value.revenant_corruption == true) { - output = output + "14"; + flag_values.push_back("14"); } if (attribute_value.revenant_devastation == true) { - output = output + "15"; + flag_values.push_back("15"); } if (attribute_value.revenant_invocation == true) { - output = output + "3"; + flag_values.push_back("3"); } if (attribute_value.revenant_retribution == true) { - output = output + "9"; + flag_values.push_back("9"); } if (attribute_value.revenant_salvation == true) { - output = output + "12"; + flag_values.push_back("12"); } if (attribute_value.thief_acrobatics == true) { - output = output + "54"; + flag_values.push_back("54"); } if (attribute_value.thief_critical_strikes == true) { - output = output + "35"; + flag_values.push_back("35"); } if (attribute_value.thief_deadly_arts == true) { - output = output + "28"; + flag_values.push_back("28"); } if (attribute_value.thief_shadow_arts == true) { - output = output + "20"; + flag_values.push_back("20"); } if (attribute_value.thief_trickery == true) { - output = output + "44"; + flag_values.push_back("44"); } if (attribute_value.warrior_arms == true) { - output = output + "36"; + flag_values.push_back("36"); } if (attribute_value.warrior_defense == true) { - output = output + "22"; + flag_values.push_back("22"); } if (attribute_value.warrior_discipline == true) { - output = output + "51"; + flag_values.push_back("51"); } if (attribute_value.warrior_strength == true) { - output = output + "4"; + flag_values.push_back("4"); } if (attribute_value.warrior_tactics == true) { - output = output + "11"; + flag_values.push_back("11"); + } + string output = ""; + for (size_t i = 0; i < flag_values.size(); ++i) { + output += flag_values[i]; + if (i < flag_values.size() - 1){ + output += ","; + } } return output; } diff --git a/xml_converter/src/attribute/species_filter_gen.cpp b/xml_converter/src/attribute/species_filter_gen.cpp index d2f3ad6c..f82834ee 100644 --- a/xml_converter/src/attribute/species_filter_gen.cpp +++ b/xml_converter/src/attribute/species_filter_gen.cpp @@ -48,21 +48,28 @@ SpeciesFilter parse_species_filter(rapidxml::xml_attribute<>* input, vector flag_values; if (attribute_value.asura == true) { - output = output + "asura"; + flag_values.push_back("asura"); } if (attribute_value.charr == true) { - output = output + "charr"; + flag_values.push_back("charr"); } if (attribute_value.human == true) { - output = output + "human"; + flag_values.push_back("human"); } if (attribute_value.norn == true) { - output = output + "norn"; + flag_values.push_back("norn"); } if (attribute_value.sylvari == true) { - output = output + "sylvari"; + flag_values.push_back("sylvari"); + } + string output = ""; + for (size_t i = 0; i < flag_values.size(); ++i) { + output += flag_values[i]; + if (i < flag_values.size() - 1){ + output += ","; + } } return output; }