def cataloged

bendvy-ecs-core@0.1.0.4 · captured_schedule_condition.bend:59

import bendvy-ecs-core@0.1.0.4/captured_schedule_condition.bend as CapturedScheduleCondition
import Base
import bendvy-ecs-core@0.1.0.4/world.bend as W
import bendvy-ecs-core@0.1.0.4/schedule.bend as Sch
import bendvy-ecs-core@0.1.0.4/schedule_provision.bend as SP
import bendvy-ecs-core@0.1.0.4/captured_schedule.bend as Run
import bendvy-ecs-core@0.1.0.4/captured_schedule_composition.bend as Comp
import bendvy-ecs-core@0.1.0.4/ordinary_condition_composition.bend as Cond

59def cataloged(~S:Data,~C:Type,~R:Type,~E:Data,~H:Type,~B:Type,~Error:Data,~catalog:H -> H & List<&2,Comp.Identity>,~dispatch:H -> W.World<S,C,R,E> -> U32 -> Comp.Outcome<W.World<S,C,R,E>,H,Error>,~select:B -> W.World<S,C,R,E> -> U32 -> Cond.Evaluation<W.World<S,C,R,E>,B>,~provision:W.World<S,C,R,E> -> W.World<S,C,R,E> & List<&2,SP.Requirement<S>>,world:W.World<S,C,R,E>,name:String,+plan:SP.Plan<S>,conditions:Cond.Bindings<W.World<S,C,R,E>,B,select>,observed:H & List<&2,Comp.Identity>) -> Run.Run<W.World<S,C,R,E>,Owned<S,C,R,E,H,B,Error,catalog,dispatch,select>,S,Cond.Error<Error>>:
60  match world conditions observed:
61    case W.World{+ns,allocator,store,resource,events,pending,+regs,sid,clock}, Cond.Bindings{state,+facts}, (owners,+entries):allowed(~S,~C,~R,~E,~H,~B,~Error,~catalog,~dispatch,~select,~provision,Bool.and(Comp.identities_valid(ns,regs,entries,[]),Bool.and(Comp.identities_valid(ns,regs,condition_identities(facts),[]),Bool.and(Cond.unique_bindings(facts,[]),Bool.and(Cond.binding_targets(facts,SP.flatten(~S,plan)),Bool.and(Run.canonical_steps(SP.flatten(~S,plan)),Sch.valid(SP.flatten(~S,plan),Comp.ids(entries),[])))))),owners,Cond.Bindings{state,facts},W.World{ns,allocator,store,resource,events,pending,regs,sid,clock},name,plan)

Uses (25)

Used by (1)