Skip to content

Add provinces, dynasties, religions, holdings and expand alive data#19

Draft
clemux wants to merge 5 commits into
rakaly:masterfrom
clemux:extend_models
Draft

Add provinces, dynasties, religions, holdings and expand alive data#19
clemux wants to merge 5 commits into
rakaly:masterfrom
clemux:extend_models

Conversation

@clemux
Copy link
Copy Markdown

@clemux clemux commented May 26, 2023

I'll leave this a draft for now, because I haven't written any tests, and I'm not sure about what fields should be Option.

I've tested it on a single save with 0 playtime, with the 1.9 patch, and it works with this thing I patched together

Comment thread src/models/gamestate.rs
#[derive(Debug, Deserialize)]
pub struct Holding {
pub r#type: Option<String>,
pub buildings: Vec<Building>,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some saves that omit buildings, and my guess is that paradox often excludes fields that are empty or their default values, so I tend to prefer to use #[serde(default)] and not use Option too much unless there is a difference between empty/0 and None in game.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants