Skip to content

Commit

Permalink
Updated submodules, fixed Debug config (#154)
Browse files Browse the repository at this point in the history
* Fix Debug config

* Update submodules

* Removed registerMatcher calls

* Update ImperatorToCK3.vcxproj

* Fix Release config
  • Loading branch information
IhateTrains authored Mar 9, 2021
1 parent a6895fa commit 9cb2dbe
Show file tree
Hide file tree
Showing 56 changed files with 77 additions and 78 deletions.
10 changes: 6 additions & 4 deletions ImperatorToCK3/ImperatorToCK3.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<TargetName>ImperatorToCK3Converter</TargetName>
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
<CodeAnalysisRuleSet>NativeMinimumRules.ruleset</CodeAnalysisRuleSet>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(ProjectDir)\..\$(Configuration)\ImperatorToCK3\</OutDir>
Expand All @@ -89,7 +90,7 @@
<LibraryPath>$(LibraryPath)</LibraryPath>
<IncludePath>$(UniversalCRT_IncludePath);$(IncludePath)</IncludePath>
<ReferencePath>$(ReferencePath)</ReferencePath>
<LinkIncremental>false</LinkIncremental>
<LinkIncremental>true</LinkIncremental>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>NativeRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
Expand Down Expand Up @@ -132,10 +133,11 @@
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<AdditionalIncludeDirectories>Source;..\imageMagick\include-windows;..\commonItems;..\commonItems\compile-time-regular-expressions\single-header;..\cpp-base64;..\ZipLib;$(WindowsSDK_IncludePath)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>Source;..\imageMagick\include-windows;..\commonItems;..\cpp-base64;..\ZipLib;$(WindowsSDK_IncludePath)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_UNICODE;UNICODE;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;_SILENCE_CXX20_U8PATH_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down Expand Up @@ -185,12 +187,13 @@
<SDLCheck>true</SDLCheck>
<ConformanceMode>false</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<AdditionalIncludeDirectories>Source;..\imageMagick\include-windows;..\commonItems;..\commonItems\compile-time-regular-expressions\single-header;..\cpp-base64;..\ZipLib;$(WindowsSDK_IncludePath)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>Source;..\imageMagick\include-windows;..\commonItems;..\cpp-base64;..\ZipLib;$(WindowsSDK_IncludePath)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_UNICODE;UNICODE;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;_SILENCE_CXX20_U8PATH_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WholeProgramOptimization>true</WholeProgramOptimization>
<EnablePREfast>true</EnablePREfast>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<DebugInformationFormat>None</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down Expand Up @@ -307,7 +310,6 @@
<ClInclude Include="..\commonItems\Color.h" />
<ClInclude Include="..\commonItems\CommonFunctions.h" />
<ClInclude Include="..\commonItems\CommonRegexes.h" />
<ClInclude Include="..\commonItems\compile-time-regular-expressions\single-header\ctre.hpp" />
<ClInclude Include="..\commonItems\ConvenientParser.h" />
<ClInclude Include="..\commonItems\Date.h" />
<ClInclude Include="..\commonItems\GameVersion.h" />
Expand Down
3 changes: 0 additions & 3 deletions ImperatorToCK3/ImperatorToCK3.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,6 @@
<ClInclude Include="..\commonItems\CommonRegexes.h">
<Filter>commonItems</Filter>
</ClInclude>
<ClInclude Include="..\commonItems\compile-time-regular-expressions\single-header\ctre.hpp">
<Filter>commonItems</Filter>
</ClInclude>
<ClInclude Include="..\commonItems\ConvenientParser.h">
<Filter>commonItems</Filter>
</ClInclude>
Expand Down
4 changes: 2 additions & 2 deletions ImperatorToCK3/Source/CK3/Province/CK3ProvinceMappings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ CK3::ProvinceMappings::ProvinceMappings(const std::string& theFile) {


void CK3::ProvinceMappings::registerKeys() {
registerMatcher(commonItems::integerMatch, [this](const std::string& provIDStr, std::istream& theStream) {
registerRegex(commonItems::integerRegex, [this](const std::string& provIDStr, std::istream& theStream) {
auto targetProvID = commonItems::stringToInteger<unsigned long long>(provIDStr);
auto baseProvID = commonItems::getULlong(theStream);
if (targetProvID != baseProvID) // if left and right IDs are equal, no point in mapping
mappings.emplace(targetProvID, baseProvID);
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}
4 changes: 2 additions & 2 deletions ImperatorToCK3/Source/CK3/Province/CK3Provinces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ CK3::Provinces::Provinces(const std::string& filePath) {


void CK3::Provinces::registerKeys() {
registerMatcher(commonItems::integerMatch, [this](const std::string& provIdStr, std::istream& theStream) {
registerRegex(commonItems::integerRegex, [this](const std::string& provIdStr, std::istream& theStream) {
auto provID = commonItems::stringToInteger<unsigned long long>(provIdStr);
auto newProvince = std::make_shared<Province>(provID, theStream);
provinces.emplace(provID, newProvince);
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}
2 changes: 1 addition & 1 deletion ImperatorToCK3/Source/CK3/Titles/LandedTitles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void CK3::LandedTitles::registerKeys() {

Title::addFoundTitle(newTitle, foundTitles);
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}


Expand Down
2 changes: 1 addition & 1 deletion ImperatorToCK3/Source/CK3/Titles/Title.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void CK3::Title::registerKeys() {
registerKeyword("province", [this](std::istream& theStream) {
province = commonItems::getULlong(theStream);
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}


Expand Down
6 changes: 3 additions & 3 deletions ImperatorToCK3/Source/CK3/Titles/TitlesHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void CK3::TitlesHistory::TitlesHistory::registerKeys() {
currentGovernmentMap[titleName] = titleHistory.currentGovernmentWithDate.second;
}
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}


Expand Down Expand Up @@ -74,7 +74,7 @@ void CK3::TitleHistory::TitleHistory::registerKeys() {
currentGovernmentWithDate = std::pair(date(dateStr), *historyEntry.government);
}
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}


Expand All @@ -96,5 +96,5 @@ void CK3::DatedHistoryEntry::DatedHistoryEntry::registerKeys() {
registerKeyword("government", [this](std::istream& theStream) {
government = commonItems::getString(theStream);
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}
2 changes: 1 addition & 1 deletion ImperatorToCK3/Source/Configuration/Configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void Configuration::registerKeys() {
convertBirthAndDeathDates = false;
Log(LogLevel::Info) << "Conversion of characters' birth and death dates set to: " << convertBirthAndDeathDates;
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ void Imperator::CharacterAttributes::registerKeys() {
registerKeyword("zeal", [this](std::istream& theStream) {
zeal = commonItems::getInt(theStream);
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Imperator::Character::Factory::Factory() {
character->attributes.charisma = attributesFromBloc.getCharisma();
character->attributes.zeal = attributesFromBloc.getZeal();
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ void Imperator::CharacterName::registerKeys() {
registerKeyword("name", [this](std::istream& theStream) {
name = commonItems::getString(theStream);
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}
6 changes: 3 additions & 3 deletions ImperatorToCK3/Source/Imperator/Characters/Characters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ Imperator::Characters::Characters(std::istream& theStream, const std::shared_ptr


void Imperator::Characters::registerKeys() {
registerMatcher(commonItems::integerMatch, [this](const std::string& charID, std::istream& theStream) {
registerRegex(commonItems::integerRegex, [this](const std::string& charID, std::istream& theStream) {
std::shared_ptr<Character> newCharacter = characterFactory.getCharacter(theStream, charID, genes);
characters.emplace(newCharacter->getID(), newCharacter);
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}


Expand Down Expand Up @@ -125,5 +125,5 @@ void Imperator::CharactersBloc::registerKeys() {
registerKeyword("character_database", [this](std::istream& theStream) {
characters = Characters(theStream, genes);
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}
6 changes: 3 additions & 3 deletions ImperatorToCK3/Source/Imperator/Countries/Countries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ Imperator::Countries::Countries(std::istream& theStream) {
}

void Imperator::Countries::registerKeys() {
registerMatcher(commonItems::integerMatch, [this](const std::string& countryID, std::istream& theStream) {
registerRegex(commonItems::integerRegex, [this](const std::string& countryID, std::istream& theStream) {
std::shared_ptr<Country> newCountry = countryFactory.getCountry(theStream, commonItems::stringToInteger<unsigned long long>(countryID));
countries.emplace(newCountry->getID(), newCountry);
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}


Expand All @@ -32,7 +32,7 @@ void Imperator::CountriesBloc::registerKeys() {
registerKeyword("country_database", [this](std::istream& theStream) {
countries = Countries(theStream);
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ void Imperator::CountryCurrencies::registerKeys() {
registerSetter("aggressive_expansion", aggressive_expansion);
registerSetter("political_influence", political_influence);
registerSetter("military_experience", military_experience);
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Imperator::Country::Factory::Factory() {
registerRegex(tribalLawRegexStr, [this](const std::string& unused, std::istream& theStream) {
country->tribalLaws.emplace(commonItems::getString(theStream));
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}


Expand Down
2 changes: 1 addition & 1 deletion ImperatorToCK3/Source/Imperator/Countries/CountryName.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ void Imperator::CountryName::registerKeys() {
registerKeyword("name", [this](std::istream& theStream) {
name = commonItems::getString(theStream);
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}
6 changes: 3 additions & 3 deletions ImperatorToCK3/Source/Imperator/Families/Families.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void Imperator::Families::loadFamilies(std::istream& theStream) {


void Imperator::Families::registerKeys() {
registerMatcher(commonItems::integerMatch, [this](const std::string& theFamilyID, std::istream& theStream) {
registerRegex(commonItems::integerRegex, [this](const std::string& theFamilyID, std::istream& theStream) {
const auto familyStr = commonItems::stringOfItem(theStream).getString();
if (familyStr.find('{') != std::string::npos) {
std::stringstream tempStream(familyStr);
Expand All @@ -33,7 +33,7 @@ void Imperator::Families::registerKeys() {
}
}
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}


Expand All @@ -49,5 +49,5 @@ void Imperator::FamiliesBloc::registerKeys() {
registerKeyword("families", [this](std::istream& theStream) {
families.loadFamilies(theStream);
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}
2 changes: 1 addition & 1 deletion ImperatorToCK3/Source/Imperator/Families/FamilyFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Imperator::Family::Factory::Factory() {
family->members.emplace_back(memberID, nullptr);
}
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}


Expand Down
4 changes: 2 additions & 2 deletions ImperatorToCK3/Source/Imperator/Genes/AccessoryGene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ void Imperator::AccessoryGene::registerKeys() {
if (commonItems::getString(theStream) == "yes")
inheritable = true;
});
registerMatcher(commonItems::stringMatch, [this](const std::string& geneTemplateName, std::istream& theStream) {
registerRegex(commonItems::stringRegex, [this](const std::string& geneTemplateName, std::istream& theStream) {
geneTemplates.insert({ geneTemplateName, AccessoryGeneTemplate(theStream) });
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ void Imperator::AccessoryGeneTemplate::registerKeys() {
ageSexWeightBlocks.insert(std::pair(ageSexStr, ageSexWeightBlocks.find(sexAge)->second));
}
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}
4 changes: 2 additions & 2 deletions ImperatorToCK3/Source/Imperator/Genes/AccessoryGenes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ void Imperator::AccessoryGenes::registerKeys() {
registerKeyword("index", [this](std::istream& theStream) {
index = commonItems::getInt(theStream);
});
registerMatcher(commonItems::stringMatch, [this](const std::string& geneName, std::istream& theStream) {
registerRegex(commonItems::stringRegex, [this](const std::string& geneName, std::istream& theStream) {
genes.emplace(geneName, AccessoryGene(theStream));
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}
2 changes: 1 addition & 1 deletion ImperatorToCK3/Source/Imperator/Genes/GenesDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ void Imperator::GenesDB::registerKeys() {
registerKeyword("accessory_genes", [this](std::istream& theStream) {
accessoryGenes = AccessoryGenes(theStream);
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}
4 changes: 2 additions & 2 deletions ImperatorToCK3/Source/Imperator/Genes/WeightBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Imperator::WeightBlock::WeightBlock(std::istream& theStream) {


void Imperator::WeightBlock::registerKeys() {
registerMatcher(commonItems::integerMatch, [this](const std::string& absoluteWeightStr, std::istream& theStream) {
registerRegex(commonItems::integerRegex, [this](const std::string& absoluteWeightStr, std::istream& theStream) {
const auto newObjectName = commonItems::getString(theStream);
try {
addObject(newObjectName, stoi(absoluteWeightStr));
Expand All @@ -22,7 +22,7 @@ void Imperator::WeightBlock::registerKeys() {
Log(LogLevel::Error) << "Undefined error, absolute weight value was: " << absoluteWeightStr << "; Error message: " << e.what();
}
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}


Expand Down
2 changes: 1 addition & 1 deletion ImperatorToCK3/Source/Imperator/ImperatorWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Imperator::World::World(const Configuration& theConfiguration) {
LOG(LogLevel::Info) << ">> Loaded " << pops.getPops().size() << " pops.";
});

registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);

LOG(LogLevel::Info) << "-> Verifying Imperator save.";
verifySave(theConfiguration.getSaveGamePath());
Expand Down
2 changes: 1 addition & 1 deletion ImperatorToCK3/Source/Imperator/Provinces/PopFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Imperator::Pop::Factory::Factory() {
registerKeyword("religion", [this](std::istream& theStream) {
pop->religion = commonItems::getString(theStream);
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}


Expand Down
6 changes: 3 additions & 3 deletions ImperatorToCK3/Source/Imperator/Provinces/Pops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ void Imperator::Pops::loadPops(std::istream& theStream) {


void Imperator::Pops::registerKeys() {
registerMatcher(commonItems::integerMatch, [this](const std::string& thePopID, std::istream& theStream) {
registerRegex(commonItems::integerRegex, [this](const std::string& thePopID, std::istream& theStream) {
const auto popStr = commonItems::stringOfItem(theStream).getString();
if (popStr.find('{') != std::string::npos) {
std::stringstream tempStream(popStr);
auto pop = popFactory.getPop(thePopID, tempStream);
pops.emplace(pop->getID(), std::move(pop));
}
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}


Expand All @@ -39,5 +39,5 @@ void Imperator::PopsBloc::registerKeys() {
registerKeyword("population", [this](std::istream& theStream) {
pops.loadPops(theStream);
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Imperator::Province::Factory::Factory() {
const auto buildingsVector = commonItems::getInts(theStream);
province->buildingsCount = std::accumulate(buildingsVector.begin(), buildingsVector.end(), 0);
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}


Expand Down
2 changes: 1 addition & 1 deletion ImperatorToCK3/Source/Imperator/Provinces/ProvinceName.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ void Imperator::ProvinceName::registerKeys() {
registerKeyword("name", [this](std::istream& theStream) {
name = commonItems::getString(theStream);
});
registerMatcher(commonItems::catchallRegexMatch, commonItems::ignoreItem);
registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);
}
Loading

0 comments on commit 9cb2dbe

Please sign in to comment.