def requirements
bendvy-ecs-core@0.1.0.4 · relation_query.bend:71
import bendvy-ecs-core@0.1.0.4/relation_query.bend as RelationQuery
import Base
import entity_key.bend as Key
import relation_types.bend as G
import query.bend as Q
71def requirements(~S:Data,remaining:List<&2,Requirement<S>>,+graph:G.Graph<S>,+namespace:U32,+id:Key.Key,selected:Bool,acc:List<&2,Cell<S>>) -> Bool & List<&2,Cell<S>>:
72 match remaining:
73 case []: (selected,List.reverse(&2,Cell<S>,acc))
74 case Requirement{key,descriptor,+end,mode,project} <> rest:
75 +observed = value(~S,graph,descriptor,end,namespace,id)
76 requirements(~S,rest,graph,namespace,id,selected && Q.selection_aux(~Bool,mode,presence(~S,observed)),add_cell(~S,project,key,end,observed,acc))