///|
pub(all) struct ScanCycleCounters {
mut active_slots_scanned : Int
mut sections_released : Int
mut switches_released : Int
} derive(Debug)
///|
fn ScanCycleCounters::new() -> ScanCycleCounters {
{ active_slots_scanned: 0, sections_released: 0, switches_released: 0 }
}
///|
fn SimulationEngine::process_active_routes_fast(
self : SimulationEngine,
) -> ScanCycleCounters {
let counters = ScanCycleCounters::new()
let mut slot = 1
while slot < 256 {
counters.active_slots_scanned = counters.active_slots_scanned + 1
if self.table.is_active_slot(slot) {
let route_id = @interlocking.RouteId::new(slot)
let release = self.table.process_sectional_release_fast(
self.station,
route_id,
)
counters.sections_released = counters.sections_released +
release.sections_unlocked
counters.switches_released = counters.switches_released +
release.switches_unlocked
}
slot = slot + 1
}
counters
}