def capacity_checked

bendvy-ecs-core@0.1.0.4 · event_runtime.bend:80

import bendvy-ecs-core@0.1.0.4/event_runtime.bend as EventRuntime
import 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))

Uses (6)

Used by (1)