Rehost annual stock repurchase policy branch
This commit is contained in:
parent
5e19e8985a
commit
0658626a57
8 changed files with 592 additions and 17 deletions
|
|
@ -108,6 +108,7 @@ struct SaveSliceProjection {
|
|||
has_chairman_selection_override: bool,
|
||||
selected_chairman_profile_id: Option<u32>,
|
||||
chairman_issue_opinion_terms_raw_i32: BTreeMap<u32, Vec<i32>>,
|
||||
chairman_personality_raw_u8: BTreeMap<u32, u8>,
|
||||
candidate_availability: BTreeMap<String, u32>,
|
||||
named_locomotive_availability: BTreeMap<String, u32>,
|
||||
locomotive_catalog: Option<Vec<RuntimeLocomotiveCatalogEntry>>,
|
||||
|
|
@ -318,6 +319,7 @@ pub fn project_save_slice_to_runtime_state_import(
|
|||
.world_issue_opinion_base_terms_raw_i32,
|
||||
company_market_state: projection.company_market_state,
|
||||
chairman_issue_opinion_terms_raw_i32: projection.chairman_issue_opinion_terms_raw_i32,
|
||||
chairman_personality_raw_u8: projection.chairman_personality_raw_u8,
|
||||
..RuntimeServiceState::default()
|
||||
},
|
||||
};
|
||||
|
|
@ -448,6 +450,11 @@ pub fn project_save_slice_overlay_to_runtime_state_import(
|
|||
.chairman_issue_opinion_terms_raw_i32
|
||||
.clone()
|
||||
},
|
||||
chairman_personality_raw_u8: if projection.has_chairman_projection {
|
||||
projection.chairman_personality_raw_u8
|
||||
} else {
|
||||
base_state.service_state.chairman_personality_raw_u8.clone()
|
||||
},
|
||||
..base_state.service_state.clone()
|
||||
},
|
||||
};
|
||||
|
|
@ -867,6 +874,10 @@ fn project_save_slice_components(
|
|||
.world_finance_neighborhood_state
|
||||
.as_ref()
|
||||
.map(|state| state.dividend_policy_raw_u8),
|
||||
building_density_growth_setting_raw_u32: save_slice
|
||||
.world_finance_neighborhood_state
|
||||
.as_ref()
|
||||
.map(|state| state.building_density_growth_setting_raw_u32),
|
||||
stock_issue_and_buyback_allowed: save_slice
|
||||
.world_finance_neighborhood_state
|
||||
.as_ref()
|
||||
|
|
@ -1227,6 +1238,7 @@ fn project_save_slice_components(
|
|||
has_chairman_selection_override,
|
||||
selected_chairman_profile_id,
|
||||
chairman_issue_opinion_terms_raw_i32,
|
||||
chairman_personality_raw_u8,
|
||||
) = if let Some(table) = &save_slice.chairman_profile_table {
|
||||
metadata.insert(
|
||||
"save_slice.chairman_profile_table_source_kind".to_string(),
|
||||
|
|
@ -1253,6 +1265,7 @@ fn project_save_slice_components(
|
|||
table.selected_chairman_profile_id.is_some(),
|
||||
table.selected_chairman_profile_id,
|
||||
BTreeMap::new(),
|
||||
BTreeMap::new(),
|
||||
)
|
||||
} else {
|
||||
(
|
||||
|
|
@ -1279,10 +1292,26 @@ fn project_save_slice_components(
|
|||
.iter()
|
||||
.map(|entry| (entry.profile_id, entry.issue_opinion_terms_raw_i32.clone()))
|
||||
.collect::<BTreeMap<_, _>>(),
|
||||
table
|
||||
.entries
|
||||
.iter()
|
||||
.filter_map(|entry| {
|
||||
entry
|
||||
.personality_byte_0x291
|
||||
.map(|value| (entry.profile_id, value))
|
||||
})
|
||||
.collect::<BTreeMap<_, _>>(),
|
||||
)
|
||||
}
|
||||
} else {
|
||||
(Vec::new(), false, false, None, BTreeMap::new())
|
||||
(
|
||||
Vec::new(),
|
||||
false,
|
||||
false,
|
||||
None,
|
||||
BTreeMap::new(),
|
||||
BTreeMap::new(),
|
||||
)
|
||||
};
|
||||
|
||||
let named_locomotive_cost = BTreeMap::new();
|
||||
|
|
@ -1374,6 +1403,7 @@ fn project_save_slice_components(
|
|||
has_chairman_selection_override,
|
||||
selected_chairman_profile_id,
|
||||
chairman_issue_opinion_terms_raw_i32,
|
||||
chairman_personality_raw_u8,
|
||||
candidate_availability,
|
||||
named_locomotive_availability,
|
||||
locomotive_catalog,
|
||||
|
|
@ -5326,6 +5356,7 @@ mod tests {
|
|||
holdings_value_total: 700,
|
||||
net_worth_total: 1200,
|
||||
purchasing_power_total: 1500,
|
||||
personality_byte_0x291: Some(12),
|
||||
issue_opinion_terms_raw_i32: Vec::new(),
|
||||
},
|
||||
crate::SmpLoadedChairmanProfileEntry {
|
||||
|
|
@ -5338,6 +5369,7 @@ mod tests {
|
|||
holdings_value_total: 600,
|
||||
net_worth_total: 900,
|
||||
purchasing_power_total: 1100,
|
||||
personality_byte_0x291: Some(20),
|
||||
issue_opinion_terms_raw_i32: Vec::new(),
|
||||
},
|
||||
],
|
||||
|
|
@ -6019,6 +6051,8 @@ mod tests {
|
|||
bankruptcy_policy_raw_hex: "0x00".to_string(),
|
||||
dividend_policy_raw_u8: 1,
|
||||
dividend_policy_raw_hex: "0x01".to_string(),
|
||||
building_density_growth_setting_raw_u32: 1,
|
||||
building_density_growth_setting_raw_hex: "0x00000001".to_string(),
|
||||
labels: vec![
|
||||
"current_calendar_tuple_word".to_string(),
|
||||
"current_calendar_tuple_word_2".to_string(),
|
||||
|
|
@ -13956,6 +13990,7 @@ mod tests {
|
|||
world_issue_opinion_base_terms_raw_i32: Vec::new(),
|
||||
company_market_state: BTreeMap::new(),
|
||||
chairman_issue_opinion_terms_raw_i32: BTreeMap::new(),
|
||||
chairman_personality_raw_u8: BTreeMap::new(),
|
||||
},
|
||||
};
|
||||
let save_slice = SmpLoadedSaveSlice {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue