diff --git a/ImperatorToCK3/ImperatorToCK3.vcxproj b/ImperatorToCK3/ImperatorToCK3.vcxproj index 29e1121d1..ce8351ee2 100644 --- a/ImperatorToCK3/ImperatorToCK3.vcxproj +++ b/ImperatorToCK3/ImperatorToCK3.vcxproj @@ -1,14 +1,6 @@ - - Debug - Win32 - - - Release - Win32 - Debug x64 @@ -25,19 +17,6 @@ 10.0 - - Application - true - v142 - Unicode - - - Application - false - v142 - true - Unicode - Application true @@ -58,12 +37,6 @@ - - - - - - @@ -97,38 +70,6 @@ true NativeRecommendedRules.ruleset - - $(ExecutablePath) - $(ProjectDir)\..\$(Configuration)\ImperatorToCK3\ - $(SolutionDir)\ReleaseIntermediate\ - ImperatorToCK3Converter - $(UniversalCRT_IncludePath);$(IncludePath) - $(ReferencePath) - $(LibraryPath) - $(LibraryWPath) - $(SourcePath) - $(ExcludePath) - true - - - $(ProjectDir)\..\$(Configuration)\ImperatorToCK3\ - $(SolutionDir)\ReleaseIntermediate\ - ImperatorToCK3Converter - - - - Level3 - Disabled - true - true - stdcpp17 - ..\commonItems;..\ZipLib;$(WindowsSDK_IncludePath) - _UNICODE;UNICODE;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions) - - - Console - - Level4 @@ -156,32 +97,6 @@ - - - Level3 - MaxSpeed - true - true - true - true - stdcpp17 - true - ..\commonItems;..\commonItems\compile-time-regular-expressions\single-header;..\cpp-base64;..\ZipLib;$(WindowsSDK_IncludePath) - _UNICODE;UNICODE;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions) - - - Console - true - true - %(AdditionalDependencies) - - - Copy_Files.bat - - - Copying Data Files - - Level3 diff --git a/ImperatorToCK3/Source/CK3/CK3World.cpp b/ImperatorToCK3/Source/CK3/CK3World.cpp index 32e56566f..1c6bf582d 100644 --- a/ImperatorToCK3/Source/CK3/CK3World.cpp +++ b/ImperatorToCK3/Source/CK3/CK3World.cpp @@ -305,14 +305,13 @@ void CK3::World::overWriteCountiesHistory() { title->setHolder(holderItr->second); } title->setDeFactoLiege(nullptr); - countyHoldersCache.emplace(title->getHolder()->ID); + countyHoldersCache.emplace(title->getHolderID()); } } } else { // county is probably outside of Imperator map - const auto& titleHolderID = title->getHolder()->ID; - if (!titleHolderID.empty() && titleHolderID != "0") - countyHoldersCache.emplace(titleHolderID); + if (!title->getHolderID().empty() && title->getHolderID() != "0") + countyHoldersCache.emplace(title->getHolderID()); } } } @@ -328,7 +327,7 @@ void CK3::World::removeInvalidLandlessTitles() { for (const auto& [name, title] : getTitles()) { //important check: if duchy/kingdom/empire title holder holds no county (is landless), remove the title // this also removes landless titles initialized from Imperator - if (title->getRank()!=TitleRank::county && title->getRank()!=TitleRank::barony && !countyHoldersCache.contains(title->getHolder()->ID)) { + if (title->getRank()!=TitleRank::county && title->getRank()!=TitleRank::barony && !countyHoldersCache.contains(title->getHolderID())) { if (!getTitles().find(name)->second->isLandless()) { // does not have landless attribute set to true if (title->isImportedOrUpdatedFromImperator() && name.find("IMPTOCK3") != string::npos) { removedGeneratedTitles.emplace(name); @@ -373,7 +372,7 @@ void CK3::World::purgeLandlessVanillaCharacters() { } for (const auto& titlePtr : getTitles() | std::views::values) { - farewellIDs.erase(titlePtr->getHolder()->ID); + farewellIDs.erase(titlePtr->getHolderID()); } for (const auto& characterId : farewellIDs) { characters[characterId]->breakAllLinks(); diff --git a/ImperatorToCK3/Source/CK3/Titles/Title.h b/ImperatorToCK3/Source/CK3/Titles/Title.h index a67e33ae4..f88ae1a4b 100644 --- a/ImperatorToCK3/Source/CK3/Titles/Title.h +++ b/ImperatorToCK3/Source/CK3/Titles/Title.h @@ -76,7 +76,8 @@ class Title: commonItems::parser, public std::enable_shared_from_this { [[nodiscard]] auto getRank() const { return rank; } [[nodiscard]] auto isLandless() const { return landless; } [[nodiscard]] auto hasDefiniteForm() const { return definiteForm; } - [[nodiscard]] const auto& getHolder() const { return holderPtr; } + [[nodiscard]] const auto& getHolderID() const { return history.holder; } + [[nodiscard]] const auto& getHolderPtr() const { return holderPtr; } [[nodiscard]] const auto& getGovernment() const { return history.government; } [[nodiscard]] const auto& getDevelopmentLevel() const { return history.developmentLevel; } [[nodiscard]] std::optional<int> getOwnOrInheritedDevelopmentLevel() const; diff --git a/ImperatorToCK3/Source/CK3Outputter/outTitles.cpp b/ImperatorToCK3/Source/CK3Outputter/outTitles.cpp index 4e39d52da..b1aacc86a 100644 --- a/ImperatorToCK3/Source/CK3Outputter/outTitles.cpp +++ b/ImperatorToCK3/Source/CK3Outputter/outTitles.cpp @@ -24,7 +24,7 @@ void CK3::outputTitleHistory(const shared_ptr<Title>& title, ofstream& outputStr if (deFactoLiege) outputStream << "\t\tliege = " << deFactoLiege->getName() << "\n"; - outputStream << "\t\tholder = " << title->getHolder() << "\n"; + outputStream << "\t\tholder = " << title->getHolderID() << "\n"; const auto& govOpt = title->getGovernment(); if (govOpt) diff --git a/ImperatorToCK3Tests/CK3WorldTests/Titles/TitleTests.cpp b/ImperatorToCK3Tests/CK3WorldTests/Titles/TitleTests.cpp index 80290db4c..3694c3682 100644 --- a/ImperatorToCK3Tests/CK3WorldTests/Titles/TitleTests.cpp +++ b/ImperatorToCK3Tests/CK3WorldTests/Titles/TitleTests.cpp @@ -57,11 +57,18 @@ TEST(CK3World_TitleTests, membersDefaultToBlank) { ASSERT_FALSE(theTitle.getCapitalCounty()); } -TEST(CK3World_TitleTests, holderDefaultsTo0String) { +TEST(CK3World_TitleTests, holderIdDefaultsTo0String) { std::stringstream input; const CK3::Title theTitle; - ASSERT_EQ("0", theTitle.getHolder()->ID); + ASSERT_EQ("0", theTitle.getHolderID()); +} + +TEST(CK3World_TitleTests, holderPtrDefaultsToNullptr) { + std::stringstream input; + const CK3::Title theTitle; + + ASSERT_EQ(nullptr, theTitle.getHolderPtr()); } TEST(CK3World_TitleTests, capitalBaronyDefaultsToNullopt) { @@ -78,7 +85,7 @@ TEST(CK3World_TitleTests, historyCanBeAdded) { CK3::Title title; title.addHistory(CK3::LandedTitles{}, history); - ASSERT_EQ("420", title.getHolder()->ID); + ASSERT_EQ("420", title.getHolderID()); ASSERT_EQ(20, *title.getDevelopmentLevel()); } diff --git a/ImperatorToCK3Tests/ImperatorToCK3Tests.vcxproj b/ImperatorToCK3Tests/ImperatorToCK3Tests.vcxproj index 31019bb8c..9a1417315 100644 --- a/ImperatorToCK3Tests/ImperatorToCK3Tests.vcxproj +++ b/ImperatorToCK3Tests/ImperatorToCK3Tests.vcxproj @@ -1,14 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> <ProjectConfiguration Include="Debug|x64"> <Configuration>Debug</Configuration> <Platform>x64</Platform> @@ -25,19 +17,6 @@ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v142</PlatformToolset> - <CharacterSet>Unicode</CharacterSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v142</PlatformToolset> - <WholeProgramOptimization>false</WholeProgramOptimization> - <CharacterSet>Unicode</CharacterSet> - </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> @@ -56,12 +35,6 @@ </ImportGroup> <ImportGroup Label="Shared"> </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> @@ -69,15 +42,6 @@ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <PropertyGroup Label="UserMacros" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <LinkIncremental>false</LinkIncremental> - <IncludePath>..\commonItems;..\googletest\googlemock\include;..\googletest\googlemock;..\googletest\googletest\include;..\googletest\googletest;..\googletest;$(IncludePath)</IncludePath> - <OutDir>$(ProjectDir)$(Configuration)\</OutDir> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <LinkIncremental>true</LinkIncremental> - <IncludePath>..\commonItems;..\googletest\googlemock\include;..\googletest\googlemock;..\googletest\googletest\include;..\googletest\googletest;..\googletest;$(IncludePath)</IncludePath> - </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <LinkIncremental>true</LinkIncremental> <IntDir>$(Configuration)\</IntDir> @@ -90,45 +54,6 @@ <IntDir>$(Configuration)\</IntDir> <IncludePath>..\commonItems;..\googletest\googlemock\include;..\googletest\googlemock;..\googletest\googletest\include;..\googletest\googletest;..\googletest;$(IncludePath)</IncludePath> </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <WarningLevel>Level3</WarningLevel> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <SDLCheck>true</SDLCheck> - <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <ConformanceMode>false</ConformanceMode> - <LanguageStandard>stdcpp17</LanguageStandard> - <AdditionalIncludeDirectories>..\cpp-base64;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <MultiProcessorCompilation>true</MultiProcessorCompilation> - <Optimization>Disabled</Optimization> - <RuntimeLibrary>MultiThreaded</RuntimeLibrary> - <EnableParallelCodeGeneration>true</EnableParallelCodeGeneration> - <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> - </ClCompile> - <Link> - <SubSystem>Console</SubSystem> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - <GenerateDebugInformation>true</GenerateDebugInformation> - <OutputFile>$(ProjectDir)$(Configuration)\$(TargetName)$(TargetExt)</OutputFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <WarningLevel>Level3</WarningLevel> - <SDLCheck>true</SDLCheck> - <PreprocessorDefinitions>_DEBUG;_CONSOLE;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <ConformanceMode>true</ConformanceMode> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <LanguageStandard>stdcpp17</LanguageStandard> - </ClCompile> - <Link> - <SubSystem>Console</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <OutputFile>$(ProjectDir)$(Configuration)\$(TargetName)$(TargetExt)</OutputFile> - </Link> - </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ClCompile> <WarningLevel>Level3</WarningLevel> @@ -173,6 +98,8 @@ <ClCompile Include="..\commonItems\OSCommonLayer.cpp" /> <ClCompile Include="..\commonItems\StringUtils.cpp" /> <ClCompile Include="..\cpp-base64\base64.cpp" /> + <ClCompile Include="..\ImperatorToCK3\Source\CK3Outputter\outCharacter.cpp" /> + <ClCompile Include="..\ImperatorToCK3\Source\CK3\Character\CK3Character.cpp" /> <ClCompile Include="..\ImperatorToCK3\Source\CK3\Dynasties\Dynasty.cpp" /> <ClCompile Include="..\ImperatorToCK3\Source\CK3\Province\CK3Province.cpp" /> <ClCompile Include="..\ImperatorToCK3\Source\CK3\Province\CK3ProvinceMappings.cpp" /> diff --git a/ImperatorToCK3Tests/ImperatorToCK3Tests.vcxproj.filters b/ImperatorToCK3Tests/ImperatorToCK3Tests.vcxproj.filters index 9dbf3dd44..baf930ce5 100644 --- a/ImperatorToCK3Tests/ImperatorToCK3Tests.vcxproj.filters +++ b/ImperatorToCK3Tests/ImperatorToCK3Tests.vcxproj.filters @@ -124,6 +124,12 @@ <Filter Include="MapperTests\DeathReasonMapper"> <UniqueIdentifier>{019b65d3-db9b-416f-a670-fecff54b6fb6}</UniqueIdentifier> </Filter> + <Filter Include="Sources\CK3\Characters"> + <UniqueIdentifier>{56431e02-d0c3-4092-b36e-c00fc3af9a79}</UniqueIdentifier> + </Filter> + <Filter Include="Sources\CK3Outputter"> + <UniqueIdentifier>{4db30bce-7d0e-4982-bab0-82d11150afad}</UniqueIdentifier> + </Filter> </ItemGroup> <ItemGroup> <ClCompile Include="ImperatorWorldTests\Families\FamilyTests.cpp"> @@ -531,6 +537,12 @@ <ClCompile Include="..\ImperatorToCK3\Source\CommonUtilities\ContainerField.cpp"> <Filter>Sources\CommonUtilities</Filter> </ClCompile> + <ClCompile Include="..\ImperatorToCK3\Source\CK3\Character\CK3Character.cpp"> + <Filter>Sources\CK3\Characters</Filter> + </ClCompile> + <ClCompile Include="..\ImperatorToCK3\Source\CK3Outputter\outCharacter.cpp"> + <Filter>Sources\CK3Outputter</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\ImperatorToCK3\Source\Imperator\Provinces\Province.h"> diff --git a/commonItems b/commonItems index e905578bc..78e26292d 160000 --- a/commonItems +++ b/commonItems @@ -1 +1 @@ -Subproject commit e905578bc6c17f79e55f0acea45f693ababd9459 +Subproject commit 78e26292d84352fd22cd4f81a194fed81e5d7f3e diff --git a/googletest b/googletest index f5e592d8e..eb6e9273d 160000 --- a/googletest +++ b/googletest @@ -1 +1 @@ -Subproject commit f5e592d8ee5ffb1d9af5be7f715ce3576b8bf9c4 +Subproject commit eb6e9273dcf9c6535abb45306afe558aa961e3c3