Skip to main content

Module scratch

Module scratch 

Source
Expand description

Per-elevator scratch helper for custom strategies. Per-elevator scratch helper for custom dispatch strategies.

Custom strategies that carry per-car state (idle counters, last-served ticks, learned weights, …) typically reach for a HashMap<EntityId, T>. Each one then has to remember to drop the entry from notify_removed, or per-car state leaks every time an elevator is removed or reassigned.

PrepareScratch is a typed wrapper around that pattern with batteries — entry, get, get_mut, insert, remove, clear — and a clear name so a strategy carrying multiple buckets reads as “the per-car scratch for X” rather than “another HashMap”.

Structs§

PrepareScratch
Per-elevator scratch storage, keyed by EntityId.