def capacity_checked
import bendvy-ecs-core@0.1.0.4/event_runtime.bend as EventRuntimeimport Base
80def capacity_checked(~E: Data,overflow: Bool,+tick: Nat,+items: List<&2,E>,+rest: List<&2,Batch<E>>,+dropped: Nat,ih: Nat -> Trimmed<E>) -> Trimmed<E>:
81 match overflow:
82 case False{}: Trimmed{Batch{tick,items} <> rest,dropped}
83 case True{}: ih(Nat.max(dropped,tick))