def execute_with_barrier

bendvy-ecs-core@0.1.0.4 · checked_condition_schedule.bend:53

import bendvy-ecs-core@0.1.0.4/checked_condition_schedule.bend as CheckedConditionSchedule
import Base
import bendvy-ecs-core@0.1.0.4/ordinary_checked_bindings.bend as B
import bendvy-ecs-core@0.1.0.4/world.bend as W
import bendvy-ecs-core@0.1.0.4/system.bend as Sys
import bendvy-ecs-core@0.1.0.4/schedule.bend as Sch

53def execute_with_barrier(~S:Data,~C:Type,~R:Type,~E:Data,~H:Type,~B:Type,~select:B -> W.World<S,C,R,E> -> U32 -> B.Selection<W.World<S,C,R,E>,B>,~BodyError:Data,~dispatch:H -> W.World<S,C,R,E> -> U32 -> H & Sys.Outcome<W.World<S,C,R,E>,BodyError,Unit>,~barrier:(H & B.Bindings<W.World<S,C,R,E>,B,select>) -> W.World<S,C,R,E> -> (H & B.Bindings<W.World<S,C,R,E>,B,select>) & W.World<S,C,R,E>,steps:List<&2,Sch.Step>,owners:H & B.Bindings<W.World<S,C,R,E>,B,select>,world:W.World<S,C,R,E>,+namespace:U32,+name:String,+all:List<&2,Sch.Step>,observations:List<&2,Sch.Observation>) -> Sch.RunResult<S,C,R,E,H & B.Bindings<W.World<S,C,R,E>,B,select>,Error<BodyError>>:
54  match steps:
55    case []:Sch.Finished{Sch.Schedule{namespace,name,all,owners},world,observations}
56    case Sch.Phase{phase} <> rest:execute_with_barrier(~S,~C,~R,~E,~H,~B,~select,~BodyError,~dispatch,~barrier,rest,owners,world,namespace,name,all,List.append(&2,Sch.Observation,observations,[Sch.Entered{phase}]))
57    case Sch.Barrier{} <> rest:Sch.after_skip(~S,~C,~R,~E,~(H & B.Bindings<W.World<S,C,R,E>,B,select>),~Error<BodyError>,h => w => obs => execute_with_barrier(~S,~C,~R,~E,~H,~B,~select,~BodyError,~dispatch,~barrier,rest,h,w,namespace,name,all,obs),barrier(owners,world),List.append(&2,Sch.Observation,observations,[Sch.Applied{}]))
58    case Sch.System{id,_} <> rest:guard_with_barrier(~S,~C,~R,~E,~H,~B,~select,~BodyError,~dispatch,~barrier,h => w => obs => execute_with_barrier(~S,~C,~R,~E,~H,~B,~select,~BodyError,~dispatch,~barrier,rest,h,w,namespace,name,all,obs),owners,world,namespace,name,all,observations,id)

Uses (17)

Used by (1)