Skip to content

Commit

Permalink
Move the work on creating stories to its own file. (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
Idhrendur authored Apr 9, 2024
1 parent ef0c743 commit 1c72655
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Vic3ToHoI4lib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
<ClInclude Include="src\hoi4_world\roles\role.h" />
<ClInclude Include="src\hoi4_world\roles\roles_importer.h" />
<ClInclude Include="src\hoi4_world\roles\role_importer.h" />
<ClInclude Include="src\hoi4_world\roles\stories_creator.h" />
<ClInclude Include="src\hoi4_world\states\default_state.h" />
<ClInclude Include="src\hoi4_world\states\default_states_importer.h" />
<ClInclude Include="src\hoi4_world\states\hoi4_state.h" />
Expand Down Expand Up @@ -215,6 +216,7 @@
<ClCompile Include="src\hoi4_world\military\task_force_templates_builder.cpp" />
<ClCompile Include="src\hoi4_world\roles\roles_importer.cpp" />
<ClCompile Include="src\hoi4_world\roles\role_importer.cpp" />
<ClCompile Include="src\hoi4_world\roles\stories_creator.cpp" />
<ClCompile Include="src\hoi4_world\states\default_states_importer.cpp" />
<ClCompile Include="src\hoi4_world\states\hoi4_state.cpp" />
<ClCompile Include="src\hoi4_world\states\hoi4_states_converter.cpp" />
Expand Down
6 changes: 6 additions & 0 deletions Vic3ToHoI4lib.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,9 @@
<ClInclude Include="src\hoi4_world\roles\roles_importer.h">
<Filter>src\hoi4_world\roles</Filter>
</ClInclude>
<ClInclude Include="src\hoi4_world\roles\stories_creator.h">
<Filter>src\hoi4_world\roles</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\vic3_to_hoi4_converter.cpp">
Expand Down Expand Up @@ -1170,6 +1173,9 @@
<ClCompile Include="src\hoi4_world\roles\roles_importer.cpp">
<Filter>src\hoi4_world\roles</Filter>
</ClCompile>
<ClCompile Include="src\hoi4_world\roles\stories_creator.cpp">
<Filter>src\hoi4_world\roles</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Library Include="external\rakaly\rakaly.dll.lib">
Expand Down
13 changes: 13 additions & 0 deletions src/hoi4_world/roles/stories_creator.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "src/hoi4_world/roles/stories_creator.h"

#include "external/fmt/include/fmt/format.h"
#include "src/hoi4_world/roles/roles_importer.h"



void hoi4::CreateStories()
{
Log(LogLevel::Info) << "Writing stories";
std::map<std::string, Role> roles = ImportRoles();
Log(LogLevel::Info) << fmt::format("\tImported {} roles.", roles.size());
}
15 changes: 15 additions & 0 deletions src/hoi4_world/roles/stories_creator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifndef SRC_HOI4WORLD_ROLES_STORIESCREATOR_H
#define SRC_HOI4WORLD_ROLES_STORIESCREATOR_H



namespace hoi4
{

void CreateStories();

} // namespace hoi4



#endif // SRC_HOI4WORLD_ROLES_STORIESCREATOR_H
6 changes: 2 additions & 4 deletions src/hoi4_world/world/hoi4_world_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "src/hoi4_world/map/railways_converter.h"
#include "src/hoi4_world/map/resources_map_importer.h"
#include "src/hoi4_world/map/strategic_regions_importer.h"
#include "src/hoi4_world/roles/roles_importer.h"
#include "src/hoi4_world/roles/stories_creator.h"
#include "src/hoi4_world/states/default_states_importer.h"
#include "src/hoi4_world/states/hoi4_states_converter.h"
#include "src/hoi4_world/world/hoi4_world_framework_builder.h"
Expand Down Expand Up @@ -320,9 +320,7 @@ hoi4::World hoi4::ConvertWorld(const commonItems::ModFilesystem& hoi4_mod_filesy
hoi4::Railways railways = railways_future.get();
hoi4::Buildings buildings = buildings_future.get();

Log(LogLevel::Info) << "Writing stories";
std::map<std::string, Role> roles = ImportRoles();
Log(LogLevel::Info) << fmt::format("\tImported {} roles.", roles.size());
CreateStories();

return hoi4::World(hoi4::WorldOptions{.countries = countries,
.great_powers = great_powers,
Expand Down

0 comments on commit 1c72655

Please sign in to comment.