OrdinaryMachineSchedule.dispatch: def of bendvy-ecs-core@0.1.0.4 Import: import bendvy-ecs-core@0.1.0.4/ordinary_machine_schedule.bend as OrdinaryMachineSchedule Lines 24-32 of bendvy-ecs-core@0.1.0.4/ordinary_machine_schedule.bend: https://jend.leeeet.dev/read.txt?path=bendvy-ecs-core@0.1.0.4/ordinary_machine_schedule.bend&start_line=24&end_line=32 import Base import bendvy-ecs-core@0.1.0.4/world.bend as W import bendvy-ecs-core@0.1.0.4/system.bend as Sys # Advanced fixed-group router: ids 1/2/3 call apply/exit/transition; the remaining # case calls enter. Use with steps(), not arbitrary ids assumed validated here. # Closed callbacks must return actual owners/World and their failure outcome. def dispatch(~S:Data,~C:Type,~R:Type,~E:Data,~H:Type,~Error:Data,~apply:H -> W.World -> H & Sys.Outcome,Error,Unit>,~exit:H -> W.World -> H & Sys.Outcome,Error,Unit>,~transition:H -> W.World -> H & Sys.Outcome,Error,Unit>,~enter:H -> W.World -> H & Sys.Outcome,Error,Unit>,owners:H,world:W.World,id:U32) -> H & Sys.Outcome,Error,Unit>: match id: case 1:apply(owners,world) case 2:exit(owners,world) case 3:transition(owners,world) case _:enter(owners,world) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Con https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Nil https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/system.bend&name=Outcome https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/world.bend&name=World