feat(simulator): Add Rust API bindings for bridge-related city operations in simulator extensions

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
autocommit 2026-04-30 00:14:46 -07:00
parent a10639669d
commit 127d41dfe9

View file

@ -1546,6 +1546,20 @@ impl GdCity {
fn mark_attacked(&mut self, turn: i64) {
self.inner.mark_attacked(turn.max(0) as u32);
}
/// Mark the city as captured on `turn`. Enables the occupation production
/// penalty for the next OCCUPATION_TURNS turns.
#[func]
fn mark_captured(&mut self, turn: i64) {
self.inner.mark_captured(turn.max(0) as u32);
}
/// Returns the production multiplier for `current_turn`.
/// 0.5 while the city is under occupation (first 5 turns post-capture), 1.0 otherwise.
#[func]
fn get_occupation_production_mult(&self, current_turn: i64) -> f64 {
self.inner.occupation_production_mult(current_turn.max(0) as u32)
}
}
// ── Private helpers for GdCity ──────────────────────────────────────────