Implement ordinary packed event conditions
This commit is contained in:
parent
087ebf1097
commit
f73234cb99
28 changed files with 2624 additions and 86 deletions
|
|
@ -137,7 +137,7 @@ mod tests {
|
|||
CalendarPoint, OVERLAY_IMPORT_DOCUMENT_FORMAT_VERSION, RuntimeOverlayImportDocument,
|
||||
RuntimeOverlayImportDocumentSource, RuntimeSaveProfileState, RuntimeSaveSliceDocument,
|
||||
RuntimeSaveSliceDocumentSource, RuntimeServiceState, RuntimeSnapshotDocument,
|
||||
RuntimeSnapshotSource, RuntimeState, RuntimeWorldRestoreState,
|
||||
RuntimeSnapshotSource, RuntimeState, RuntimeTrackPieceCounts, RuntimeWorldRestoreState,
|
||||
SAVE_SLICE_DOCUMENT_FORMAT_VERSION, SNAPSHOT_FORMAT_VERSION,
|
||||
save_runtime_overlay_import_document, save_runtime_save_slice_document,
|
||||
save_runtime_snapshot_document,
|
||||
|
|
@ -174,6 +174,8 @@ mod tests {
|
|||
metadata: BTreeMap::new(),
|
||||
companies: Vec::new(),
|
||||
selected_company_id: None,
|
||||
territories: Vec::new(),
|
||||
company_territory_track_piece_counts: Vec::new(),
|
||||
packed_event_collection: None,
|
||||
event_runtime_records: Vec::new(),
|
||||
candidate_availability: BTreeMap::new(),
|
||||
|
|
@ -330,10 +332,15 @@ mod tests {
|
|||
controller_kind: rrt_runtime::RuntimeCompanyControllerKind::Human,
|
||||
current_cash: 100,
|
||||
debt: 0,
|
||||
credit_rating_score: None,
|
||||
prime_rate: None,
|
||||
track_piece_counts: RuntimeTrackPieceCounts::default(),
|
||||
active: true,
|
||||
available_track_laying_capacity: None,
|
||||
}],
|
||||
selected_company_id: Some(42),
|
||||
territories: Vec::new(),
|
||||
company_territory_track_piece_counts: Vec::new(),
|
||||
packed_event_collection: None,
|
||||
event_runtime_records: Vec::new(),
|
||||
candidate_availability: BTreeMap::new(),
|
||||
|
|
@ -391,6 +398,7 @@ mod tests {
|
|||
negative_sentinel_scope: None,
|
||||
grouped_effect_row_counts: vec![0, 0, 0, 0],
|
||||
grouped_effect_rows: vec![],
|
||||
decoded_conditions: Vec::new(),
|
||||
decoded_actions: vec![rrt_runtime::RuntimeEffect::AdjustCompanyCash {
|
||||
target: rrt_runtime::RuntimeCompanyTarget::Ids { ids: vec![42] },
|
||||
delta: 25,
|
||||
|
|
|
|||
|
|
@ -64,6 +64,10 @@ pub struct ExpectedRuntimeSummary {
|
|||
#[serde(default)]
|
||||
pub active_company_count: Option<usize>,
|
||||
#[serde(default)]
|
||||
pub territory_count: Option<usize>,
|
||||
#[serde(default)]
|
||||
pub company_territory_track_count: Option<usize>,
|
||||
#[serde(default)]
|
||||
pub packed_event_collection_present: Option<bool>,
|
||||
#[serde(default)]
|
||||
pub packed_event_record_count: Option<usize>,
|
||||
|
|
@ -90,6 +94,12 @@ pub struct ExpectedRuntimeSummary {
|
|||
#[serde(default)]
|
||||
pub packed_event_blocked_territory_condition_scope_count: Option<usize>,
|
||||
#[serde(default)]
|
||||
pub packed_event_blocked_missing_territory_context_count: Option<usize>,
|
||||
#[serde(default)]
|
||||
pub packed_event_blocked_named_territory_binding_count: Option<usize>,
|
||||
#[serde(default)]
|
||||
pub packed_event_blocked_unmapped_ordinary_condition_count: Option<usize>,
|
||||
#[serde(default)]
|
||||
pub packed_event_blocked_missing_compact_control_count: Option<usize>,
|
||||
#[serde(default)]
|
||||
pub packed_event_blocked_unmapped_real_descriptor_count: Option<usize>,
|
||||
|
|
@ -343,6 +353,22 @@ impl ExpectedRuntimeSummary {
|
|||
));
|
||||
}
|
||||
}
|
||||
if let Some(count) = self.territory_count {
|
||||
if actual.territory_count != count {
|
||||
mismatches.push(format!(
|
||||
"territory_count mismatch: expected {count}, got {}",
|
||||
actual.territory_count
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(count) = self.company_territory_track_count {
|
||||
if actual.company_territory_track_count != count {
|
||||
mismatches.push(format!(
|
||||
"company_territory_track_count mismatch: expected {count}, got {}",
|
||||
actual.company_territory_track_count
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(present) = self.packed_event_collection_present {
|
||||
if actual.packed_event_collection_present != present {
|
||||
mismatches.push(format!(
|
||||
|
|
@ -447,6 +473,30 @@ impl ExpectedRuntimeSummary {
|
|||
));
|
||||
}
|
||||
}
|
||||
if let Some(count) = self.packed_event_blocked_missing_territory_context_count {
|
||||
if actual.packed_event_blocked_missing_territory_context_count != count {
|
||||
mismatches.push(format!(
|
||||
"packed_event_blocked_missing_territory_context_count mismatch: expected {count}, got {}",
|
||||
actual.packed_event_blocked_missing_territory_context_count
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(count) = self.packed_event_blocked_named_territory_binding_count {
|
||||
if actual.packed_event_blocked_named_territory_binding_count != count {
|
||||
mismatches.push(format!(
|
||||
"packed_event_blocked_named_territory_binding_count mismatch: expected {count}, got {}",
|
||||
actual.packed_event_blocked_named_territory_binding_count
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(count) = self.packed_event_blocked_unmapped_ordinary_condition_count {
|
||||
if actual.packed_event_blocked_unmapped_ordinary_condition_count != count {
|
||||
mismatches.push(format!(
|
||||
"packed_event_blocked_unmapped_ordinary_condition_count mismatch: expected {count}, got {}",
|
||||
actual.packed_event_blocked_unmapped_ordinary_condition_count
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(count) = self.packed_event_blocked_missing_compact_control_count {
|
||||
if actual.packed_event_blocked_missing_compact_control_count != count {
|
||||
mismatches.push(format!(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue