Enhance:ini registry sequence (#121)

* '+=' supported .
* introduced registry list value deduplication .
* TechnoType listing now parse data both from ini and map .
* added UT case .
This commit is contained in:
Zero Fanker 2024-12-01 14:09:30 -05:00 committed by GitHub
parent 3e90dca667
commit 93e956e7ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 164 additions and 50 deletions

View file

@ -27,6 +27,7 @@
#include "mapdata.h"
#include "variables.h"
#include "inlines.h"
#include "IniMega.h"
#ifdef _DEBUG
@ -157,7 +158,8 @@ BOOL CBuilding::OnInitDialog()
if (upgradecount > 0) {
auto updatePowerupItems = [=](const CIniFile& ini) {
for (auto const& [seq, unitname] : ini["BuildingTypes"]) {
auto const& rules = IniMegaFile::GetRules();
for (auto const& [seq, unitname] : rules.GetSection("BuildingTypes")) {
auto const& targetBldID = ini.GetString(unitname, "PowersUpBuilding");
if (targetBldID == m_type) {
auto const desc = unitname + " (" + GetName(unitname) + ")";