Execute real packed event world and train descriptors
This commit is contained in:
parent
ca208f74e0
commit
e481274243
31 changed files with 3287 additions and 206 deletions
|
|
@ -24,12 +24,16 @@ pub struct RuntimeSummary {
|
|||
pub world_restore_disable_train_crashes_enabled: Option<bool>,
|
||||
pub world_restore_disable_train_crashes_and_breakdowns_enabled: Option<bool>,
|
||||
pub world_restore_ai_ignore_territories_at_startup_enabled: Option<bool>,
|
||||
pub world_restore_economic_status_code: Option<i32>,
|
||||
pub world_restore_absolute_counter_restore_kind: Option<String>,
|
||||
pub world_restore_absolute_counter_adjustment_context: Option<String>,
|
||||
pub metadata_count: usize,
|
||||
pub company_count: usize,
|
||||
pub active_company_count: usize,
|
||||
pub player_count: usize,
|
||||
pub train_count: usize,
|
||||
pub active_train_count: usize,
|
||||
pub retired_train_count: usize,
|
||||
pub territory_count: usize,
|
||||
pub company_territory_track_count: usize,
|
||||
pub packed_event_collection_present: bool,
|
||||
|
|
@ -55,6 +59,11 @@ pub struct RuntimeSummary {
|
|||
pub packed_event_blocked_missing_compact_control_count: usize,
|
||||
pub packed_event_blocked_unmapped_real_descriptor_count: usize,
|
||||
pub packed_event_blocked_territory_policy_descriptor_count: usize,
|
||||
pub packed_event_blocked_missing_train_context_count: usize,
|
||||
pub packed_event_blocked_missing_train_territory_context_count: usize,
|
||||
pub packed_event_blocked_confiscation_variant_count: usize,
|
||||
pub packed_event_blocked_retire_train_variant_count: usize,
|
||||
pub packed_event_blocked_retire_train_scope_count: usize,
|
||||
pub packed_event_blocked_structural_only_count: usize,
|
||||
pub event_runtime_record_count: usize,
|
||||
pub candidate_availability_count: usize,
|
||||
|
|
@ -127,6 +136,7 @@ impl RuntimeSummary {
|
|||
world_restore_ai_ignore_territories_at_startup_enabled: state
|
||||
.world_restore
|
||||
.ai_ignore_territories_at_startup_enabled,
|
||||
world_restore_economic_status_code: state.world_restore.economic_status_code,
|
||||
world_restore_absolute_counter_restore_kind: state
|
||||
.world_restore
|
||||
.absolute_counter_restore_kind
|
||||
|
|
@ -143,6 +153,9 @@ impl RuntimeSummary {
|
|||
.filter(|company| company.active)
|
||||
.count(),
|
||||
player_count: state.players.len(),
|
||||
train_count: state.trains.len(),
|
||||
active_train_count: state.trains.iter().filter(|train| train.active).count(),
|
||||
retired_train_count: state.trains.iter().filter(|train| train.retired).count(),
|
||||
territory_count: state.territories.len(),
|
||||
company_territory_track_count: state.company_territory_track_piece_counts.len(),
|
||||
packed_event_collection_present: state.packed_event_collection.is_some(),
|
||||
|
|
@ -421,6 +434,73 @@ impl RuntimeSummary {
|
|||
.count()
|
||||
})
|
||||
.unwrap_or(0),
|
||||
packed_event_blocked_missing_train_context_count: state
|
||||
.packed_event_collection
|
||||
.as_ref()
|
||||
.map(|summary| {
|
||||
summary
|
||||
.records
|
||||
.iter()
|
||||
.filter(|record| {
|
||||
record.import_outcome.as_deref()
|
||||
== Some("blocked_missing_train_context")
|
||||
})
|
||||
.count()
|
||||
})
|
||||
.unwrap_or(0),
|
||||
packed_event_blocked_missing_train_territory_context_count: state
|
||||
.packed_event_collection
|
||||
.as_ref()
|
||||
.map(|summary| {
|
||||
summary
|
||||
.records
|
||||
.iter()
|
||||
.filter(|record| {
|
||||
record.import_outcome.as_deref()
|
||||
== Some("blocked_missing_train_territory_context")
|
||||
})
|
||||
.count()
|
||||
})
|
||||
.unwrap_or(0),
|
||||
packed_event_blocked_confiscation_variant_count: state
|
||||
.packed_event_collection
|
||||
.as_ref()
|
||||
.map(|summary| {
|
||||
summary
|
||||
.records
|
||||
.iter()
|
||||
.filter(|record| {
|
||||
record.import_outcome.as_deref() == Some("blocked_confiscation_variant")
|
||||
})
|
||||
.count()
|
||||
})
|
||||
.unwrap_or(0),
|
||||
packed_event_blocked_retire_train_variant_count: state
|
||||
.packed_event_collection
|
||||
.as_ref()
|
||||
.map(|summary| {
|
||||
summary
|
||||
.records
|
||||
.iter()
|
||||
.filter(|record| {
|
||||
record.import_outcome.as_deref() == Some("blocked_retire_train_variant")
|
||||
})
|
||||
.count()
|
||||
})
|
||||
.unwrap_or(0),
|
||||
packed_event_blocked_retire_train_scope_count: state
|
||||
.packed_event_collection
|
||||
.as_ref()
|
||||
.map(|summary| {
|
||||
summary
|
||||
.records
|
||||
.iter()
|
||||
.filter(|record| {
|
||||
record.import_outcome.as_deref() == Some("blocked_retire_train_scope")
|
||||
})
|
||||
.count()
|
||||
})
|
||||
.unwrap_or(0),
|
||||
packed_event_blocked_structural_only_count: state
|
||||
.packed_event_collection
|
||||
.as_ref()
|
||||
|
|
@ -481,8 +561,8 @@ mod tests {
|
|||
use crate::{
|
||||
CalendarPoint, RuntimeCompany, RuntimeCompanyControllerKind,
|
||||
RuntimePackedEventCollectionSummary, RuntimePackedEventRecordSummary,
|
||||
RuntimeTrackPieceCounts,
|
||||
RuntimeSaveProfileState, RuntimeServiceState, RuntimeState, RuntimeWorldRestoreState,
|
||||
RuntimeSaveProfileState, RuntimeServiceState, RuntimeState, RuntimeTrackPieceCounts,
|
||||
RuntimeWorldRestoreState,
|
||||
};
|
||||
|
||||
use super::RuntimeSummary;
|
||||
|
|
@ -504,6 +584,7 @@ mod tests {
|
|||
selected_company_id: None,
|
||||
players: Vec::new(),
|
||||
selected_player_id: None,
|
||||
trains: Vec::new(),
|
||||
territories: Vec::new(),
|
||||
company_territory_track_piece_counts: Vec::new(),
|
||||
packed_event_collection: Some(RuntimePackedEventCollectionSummary {
|
||||
|
|
@ -731,6 +812,7 @@ mod tests {
|
|||
selected_company_id: None,
|
||||
players: Vec::new(),
|
||||
selected_player_id: None,
|
||||
trains: Vec::new(),
|
||||
territories: Vec::new(),
|
||||
company_territory_track_piece_counts: Vec::new(),
|
||||
packed_event_collection: None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue