Commit runtime loader and atlas updates
This commit is contained in:
parent
1040a131da
commit
b173c50c1a
19 changed files with 8425 additions and 698 deletions
|
|
@ -81,8 +81,9 @@ mod tests {
|
|||
use super::*;
|
||||
use crate::FixtureStateOrigin;
|
||||
use rrt_runtime::{
|
||||
CalendarPoint, RuntimeServiceState, RuntimeSnapshotDocument, RuntimeSnapshotSource,
|
||||
RuntimeState, SNAPSHOT_FORMAT_VERSION, save_runtime_snapshot_document,
|
||||
CalendarPoint, RuntimeSaveProfileState, RuntimeServiceState, RuntimeSnapshotDocument,
|
||||
RuntimeSnapshotSource, RuntimeState, RuntimeWorldRestoreState, SNAPSHOT_FORMAT_VERSION,
|
||||
save_runtime_snapshot_document,
|
||||
};
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
|
|
@ -111,8 +112,13 @@ mod tests {
|
|||
tick_slot: 5,
|
||||
},
|
||||
world_flags: BTreeMap::new(),
|
||||
save_profile: RuntimeSaveProfileState::default(),
|
||||
world_restore: RuntimeWorldRestoreState::default(),
|
||||
metadata: BTreeMap::new(),
|
||||
companies: Vec::new(),
|
||||
event_runtime_records: Vec::new(),
|
||||
candidate_availability: BTreeMap::new(),
|
||||
special_conditions: BTreeMap::new(),
|
||||
service_state: RuntimeServiceState::default(),
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,12 +16,77 @@ pub struct ExpectedRuntimeSummary {
|
|||
#[serde(default)]
|
||||
pub calendar: Option<rrt_runtime::CalendarPoint>,
|
||||
#[serde(default)]
|
||||
pub calendar_projection_source: Option<String>,
|
||||
#[serde(default)]
|
||||
pub calendar_projection_is_placeholder: Option<bool>,
|
||||
#[serde(default)]
|
||||
pub world_flag_count: Option<usize>,
|
||||
#[serde(default)]
|
||||
pub world_restore_selected_year_profile_lane: Option<u8>,
|
||||
#[serde(default)]
|
||||
pub world_restore_campaign_scenario_enabled: Option<bool>,
|
||||
#[serde(default)]
|
||||
pub world_restore_sandbox_enabled: Option<bool>,
|
||||
#[serde(default)]
|
||||
pub world_restore_seed_tuple_written_from_raw_lane: Option<bool>,
|
||||
#[serde(default)]
|
||||
pub world_restore_absolute_counter_requires_shell_context: Option<bool>,
|
||||
#[serde(default)]
|
||||
pub world_restore_absolute_counter_reconstructible_from_save: Option<bool>,
|
||||
#[serde(default)]
|
||||
pub world_restore_disable_cargo_economy_special_condition_slot: Option<u8>,
|
||||
#[serde(default)]
|
||||
pub world_restore_disable_cargo_economy_special_condition_reconstructible_from_save:
|
||||
Option<bool>,
|
||||
#[serde(default)]
|
||||
pub world_restore_disable_cargo_economy_special_condition_write_side_grounded: Option<bool>,
|
||||
#[serde(default)]
|
||||
pub world_restore_disable_cargo_economy_special_condition_enabled: Option<bool>,
|
||||
#[serde(default)]
|
||||
pub world_restore_use_bio_accelerator_cars_enabled: Option<bool>,
|
||||
#[serde(default)]
|
||||
pub world_restore_use_wartime_cargos_enabled: Option<bool>,
|
||||
#[serde(default)]
|
||||
pub world_restore_disable_train_crashes_enabled: Option<bool>,
|
||||
#[serde(default)]
|
||||
pub world_restore_disable_train_crashes_and_breakdowns_enabled: Option<bool>,
|
||||
#[serde(default)]
|
||||
pub world_restore_ai_ignore_territories_at_startup_enabled: Option<bool>,
|
||||
#[serde(default)]
|
||||
pub world_restore_absolute_counter_restore_kind: Option<String>,
|
||||
#[serde(default)]
|
||||
pub world_restore_absolute_counter_adjustment_context: Option<String>,
|
||||
#[serde(default)]
|
||||
pub metadata_count: Option<usize>,
|
||||
#[serde(default)]
|
||||
pub company_count: Option<usize>,
|
||||
#[serde(default)]
|
||||
pub event_runtime_record_count: Option<usize>,
|
||||
#[serde(default)]
|
||||
pub candidate_availability_count: Option<usize>,
|
||||
#[serde(default)]
|
||||
pub zero_candidate_availability_count: Option<usize>,
|
||||
#[serde(default)]
|
||||
pub special_condition_count: Option<usize>,
|
||||
#[serde(default)]
|
||||
pub enabled_special_condition_count: Option<usize>,
|
||||
#[serde(default)]
|
||||
pub save_profile_kind: Option<String>,
|
||||
#[serde(default)]
|
||||
pub save_profile_family: Option<String>,
|
||||
#[serde(default)]
|
||||
pub save_profile_map_path: Option<String>,
|
||||
#[serde(default)]
|
||||
pub save_profile_display_name: Option<String>,
|
||||
#[serde(default)]
|
||||
pub save_profile_selected_year_profile_lane: Option<u8>,
|
||||
#[serde(default)]
|
||||
pub save_profile_sandbox_enabled: Option<bool>,
|
||||
#[serde(default)]
|
||||
pub save_profile_campaign_scenario_enabled: Option<bool>,
|
||||
#[serde(default)]
|
||||
pub save_profile_staged_profile_copy_on_restore: Option<bool>,
|
||||
#[serde(default)]
|
||||
pub total_event_record_service_count: Option<u64>,
|
||||
#[serde(default)]
|
||||
pub periodic_boundary_call_count: Option<u64>,
|
||||
|
|
@ -45,6 +110,22 @@ impl ExpectedRuntimeSummary {
|
|||
));
|
||||
}
|
||||
}
|
||||
if let Some(source) = &self.calendar_projection_source {
|
||||
if actual.calendar_projection_source.as_ref() != Some(source) {
|
||||
mismatches.push(format!(
|
||||
"calendar_projection_source mismatch: expected {source:?}, got {:?}",
|
||||
actual.calendar_projection_source
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(is_placeholder) = self.calendar_projection_is_placeholder {
|
||||
if actual.calendar_projection_is_placeholder != is_placeholder {
|
||||
mismatches.push(format!(
|
||||
"calendar_projection_is_placeholder mismatch: expected {is_placeholder}, got {}",
|
||||
actual.calendar_projection_is_placeholder
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(count) = self.world_flag_count {
|
||||
if actual.world_flag_count != count {
|
||||
mismatches.push(format!(
|
||||
|
|
@ -53,6 +134,164 @@ impl ExpectedRuntimeSummary {
|
|||
));
|
||||
}
|
||||
}
|
||||
if let Some(lane) = self.world_restore_selected_year_profile_lane {
|
||||
if actual.world_restore_selected_year_profile_lane != Some(lane) {
|
||||
mismatches.push(format!(
|
||||
"world_restore_selected_year_profile_lane mismatch: expected {lane}, got {:?}",
|
||||
actual.world_restore_selected_year_profile_lane
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(enabled) = self.world_restore_campaign_scenario_enabled {
|
||||
if actual.world_restore_campaign_scenario_enabled != Some(enabled) {
|
||||
mismatches.push(format!(
|
||||
"world_restore_campaign_scenario_enabled mismatch: expected {enabled}, got {:?}",
|
||||
actual.world_restore_campaign_scenario_enabled
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(enabled) = self.world_restore_sandbox_enabled {
|
||||
if actual.world_restore_sandbox_enabled != Some(enabled) {
|
||||
mismatches.push(format!(
|
||||
"world_restore_sandbox_enabled mismatch: expected {enabled}, got {:?}",
|
||||
actual.world_restore_sandbox_enabled
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(enabled) = self.world_restore_seed_tuple_written_from_raw_lane {
|
||||
if actual.world_restore_seed_tuple_written_from_raw_lane != Some(enabled) {
|
||||
mismatches.push(format!(
|
||||
"world_restore_seed_tuple_written_from_raw_lane mismatch: expected {enabled}, got {:?}",
|
||||
actual.world_restore_seed_tuple_written_from_raw_lane
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(enabled) = self.world_restore_absolute_counter_requires_shell_context {
|
||||
if actual.world_restore_absolute_counter_requires_shell_context != Some(enabled) {
|
||||
mismatches.push(format!(
|
||||
"world_restore_absolute_counter_requires_shell_context mismatch: expected {enabled}, got {:?}",
|
||||
actual.world_restore_absolute_counter_requires_shell_context
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(enabled) = self.world_restore_absolute_counter_reconstructible_from_save {
|
||||
if actual.world_restore_absolute_counter_reconstructible_from_save != Some(enabled) {
|
||||
mismatches.push(format!(
|
||||
"world_restore_absolute_counter_reconstructible_from_save mismatch: expected {enabled}, got {:?}",
|
||||
actual.world_restore_absolute_counter_reconstructible_from_save
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(slot) = self.world_restore_disable_cargo_economy_special_condition_slot {
|
||||
if actual.world_restore_disable_cargo_economy_special_condition_slot != Some(slot) {
|
||||
mismatches.push(format!(
|
||||
"world_restore_disable_cargo_economy_special_condition_slot mismatch: expected {slot}, got {:?}",
|
||||
actual.world_restore_disable_cargo_economy_special_condition_slot
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(enabled) =
|
||||
self.world_restore_disable_cargo_economy_special_condition_reconstructible_from_save
|
||||
{
|
||||
if actual
|
||||
.world_restore_disable_cargo_economy_special_condition_reconstructible_from_save
|
||||
!= Some(enabled)
|
||||
{
|
||||
mismatches.push(format!(
|
||||
"world_restore_disable_cargo_economy_special_condition_reconstructible_from_save mismatch: expected {enabled}, got {:?}",
|
||||
actual.world_restore_disable_cargo_economy_special_condition_reconstructible_from_save
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(enabled) =
|
||||
self.world_restore_disable_cargo_economy_special_condition_write_side_grounded
|
||||
{
|
||||
if actual.world_restore_disable_cargo_economy_special_condition_write_side_grounded
|
||||
!= Some(enabled)
|
||||
{
|
||||
mismatches.push(format!(
|
||||
"world_restore_disable_cargo_economy_special_condition_write_side_grounded mismatch: expected {enabled}, got {:?}",
|
||||
actual.world_restore_disable_cargo_economy_special_condition_write_side_grounded
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(enabled) = self.world_restore_disable_cargo_economy_special_condition_enabled {
|
||||
if actual.world_restore_disable_cargo_economy_special_condition_enabled != Some(enabled)
|
||||
{
|
||||
mismatches.push(format!(
|
||||
"world_restore_disable_cargo_economy_special_condition_enabled mismatch: expected {enabled}, got {:?}",
|
||||
actual.world_restore_disable_cargo_economy_special_condition_enabled
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(enabled) = self.world_restore_use_bio_accelerator_cars_enabled {
|
||||
if actual.world_restore_use_bio_accelerator_cars_enabled != Some(enabled) {
|
||||
mismatches.push(format!(
|
||||
"world_restore_use_bio_accelerator_cars_enabled mismatch: expected {enabled}, got {:?}",
|
||||
actual.world_restore_use_bio_accelerator_cars_enabled
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(enabled) = self.world_restore_use_wartime_cargos_enabled {
|
||||
if actual.world_restore_use_wartime_cargos_enabled != Some(enabled) {
|
||||
mismatches.push(format!(
|
||||
"world_restore_use_wartime_cargos_enabled mismatch: expected {enabled}, got {:?}",
|
||||
actual.world_restore_use_wartime_cargos_enabled
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(enabled) = self.world_restore_disable_train_crashes_enabled {
|
||||
if actual.world_restore_disable_train_crashes_enabled != Some(enabled) {
|
||||
mismatches.push(format!(
|
||||
"world_restore_disable_train_crashes_enabled mismatch: expected {enabled}, got {:?}",
|
||||
actual.world_restore_disable_train_crashes_enabled
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(enabled) = self.world_restore_disable_train_crashes_and_breakdowns_enabled {
|
||||
if actual.world_restore_disable_train_crashes_and_breakdowns_enabled != Some(enabled) {
|
||||
mismatches.push(format!(
|
||||
"world_restore_disable_train_crashes_and_breakdowns_enabled mismatch: expected {enabled}, got {:?}",
|
||||
actual.world_restore_disable_train_crashes_and_breakdowns_enabled
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(enabled) = self.world_restore_ai_ignore_territories_at_startup_enabled {
|
||||
if actual.world_restore_ai_ignore_territories_at_startup_enabled != Some(enabled) {
|
||||
mismatches.push(format!(
|
||||
"world_restore_ai_ignore_territories_at_startup_enabled mismatch: expected {enabled}, got {:?}",
|
||||
actual.world_restore_ai_ignore_territories_at_startup_enabled
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(kind) = &self.world_restore_absolute_counter_restore_kind {
|
||||
if actual.world_restore_absolute_counter_restore_kind.as_ref() != Some(kind) {
|
||||
mismatches.push(format!(
|
||||
"world_restore_absolute_counter_restore_kind mismatch: expected {kind:?}, got {:?}",
|
||||
actual.world_restore_absolute_counter_restore_kind
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(context) = &self.world_restore_absolute_counter_adjustment_context {
|
||||
if actual
|
||||
.world_restore_absolute_counter_adjustment_context
|
||||
.as_ref()
|
||||
!= Some(context)
|
||||
{
|
||||
mismatches.push(format!(
|
||||
"world_restore_absolute_counter_adjustment_context mismatch: expected {context:?}, got {:?}",
|
||||
actual.world_restore_absolute_counter_adjustment_context
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(count) = self.metadata_count {
|
||||
if actual.metadata_count != count {
|
||||
mismatches.push(format!(
|
||||
"metadata_count mismatch: expected {count}, got {}",
|
||||
actual.metadata_count
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(count) = self.company_count {
|
||||
if actual.company_count != count {
|
||||
mismatches.push(format!(
|
||||
|
|
@ -69,6 +308,102 @@ impl ExpectedRuntimeSummary {
|
|||
));
|
||||
}
|
||||
}
|
||||
if let Some(count) = self.candidate_availability_count {
|
||||
if actual.candidate_availability_count != count {
|
||||
mismatches.push(format!(
|
||||
"candidate_availability_count mismatch: expected {count}, got {}",
|
||||
actual.candidate_availability_count
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(count) = self.zero_candidate_availability_count {
|
||||
if actual.zero_candidate_availability_count != count {
|
||||
mismatches.push(format!(
|
||||
"zero_candidate_availability_count mismatch: expected {count}, got {}",
|
||||
actual.zero_candidate_availability_count
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(count) = self.special_condition_count {
|
||||
if actual.special_condition_count != count {
|
||||
mismatches.push(format!(
|
||||
"special_condition_count mismatch: expected {count}, got {}",
|
||||
actual.special_condition_count
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(count) = self.enabled_special_condition_count {
|
||||
if actual.enabled_special_condition_count != count {
|
||||
mismatches.push(format!(
|
||||
"enabled_special_condition_count mismatch: expected {count}, got {}",
|
||||
actual.enabled_special_condition_count
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(kind) = &self.save_profile_kind {
|
||||
if actual.save_profile_kind.as_ref() != Some(kind) {
|
||||
mismatches.push(format!(
|
||||
"save_profile_kind mismatch: expected {kind:?}, got {:?}",
|
||||
actual.save_profile_kind
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(family) = &self.save_profile_family {
|
||||
if actual.save_profile_family.as_ref() != Some(family) {
|
||||
mismatches.push(format!(
|
||||
"save_profile_family mismatch: expected {family:?}, got {:?}",
|
||||
actual.save_profile_family
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(map_path) = &self.save_profile_map_path {
|
||||
if actual.save_profile_map_path.as_ref() != Some(map_path) {
|
||||
mismatches.push(format!(
|
||||
"save_profile_map_path mismatch: expected {map_path:?}, got {:?}",
|
||||
actual.save_profile_map_path
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(display_name) = &self.save_profile_display_name {
|
||||
if actual.save_profile_display_name.as_ref() != Some(display_name) {
|
||||
mismatches.push(format!(
|
||||
"save_profile_display_name mismatch: expected {display_name:?}, got {:?}",
|
||||
actual.save_profile_display_name
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(lane) = self.save_profile_selected_year_profile_lane {
|
||||
if actual.save_profile_selected_year_profile_lane != Some(lane) {
|
||||
mismatches.push(format!(
|
||||
"save_profile_selected_year_profile_lane mismatch: expected {lane}, got {:?}",
|
||||
actual.save_profile_selected_year_profile_lane
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(enabled) = self.save_profile_sandbox_enabled {
|
||||
if actual.save_profile_sandbox_enabled != Some(enabled) {
|
||||
mismatches.push(format!(
|
||||
"save_profile_sandbox_enabled mismatch: expected {enabled}, got {:?}",
|
||||
actual.save_profile_sandbox_enabled
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(enabled) = self.save_profile_campaign_scenario_enabled {
|
||||
if actual.save_profile_campaign_scenario_enabled != Some(enabled) {
|
||||
mismatches.push(format!(
|
||||
"save_profile_campaign_scenario_enabled mismatch: expected {enabled}, got {:?}",
|
||||
actual.save_profile_campaign_scenario_enabled
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(enabled) = self.save_profile_staged_profile_copy_on_restore {
|
||||
if actual.save_profile_staged_profile_copy_on_restore != Some(enabled) {
|
||||
mismatches.push(format!(
|
||||
"save_profile_staged_profile_copy_on_restore mismatch: expected {enabled}, got {:?}",
|
||||
actual.save_profile_staged_profile_copy_on_restore
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(count) = self.total_event_record_service_count {
|
||||
if actual.total_event_record_service_count != count {
|
||||
mismatches.push(format!(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue