def with_component

bendvy-ecs-core@0.1.0.4 · ordinary_query_declaration.bend:157

import bendvy-ecs-core@0.1.0.4/ordinary_query_declaration.bend as OrdinaryQueryDeclaration
import Base
import bendvy-ecs-core@0.1.0.4/column.bend as Col
import bendvy-ecs-core@0.1.0.4/component.bend as Cmp
import bendvy-ecs-core@0.1.0.4/ordinary_declaration.bend as Identity
import bendvy-ecs-core@0.1.0.4/compose.bend as Q

157# Filter to entities with this component without granting its payload access.
158# Produces Unit grants; combine with pair to add independently declared access.
159def with_component(~S:Data,~P:Type,~Store:Type,~R:Type,~E:Data,~Rest:Type,~V:Data,~Token:Data,~identity:Identity.Declaration<S,P>,~view:P -> P & V,~take:Store -> Rest & Col.Column<S,P>,~put:Rest -> Col.Column<S,P> -> Store) -> Declaration<S,Q.Frame<S,Store,R,E>,Unit>:
160  Declaration{Unit{},Q.family_match(~S,~Store,~R,~E,~Rest,~P,~V,~Token,~take,~put,~view,~Cmp.Family{Identity.key(~S,~P,identity)},~Q.Present{}),[Clause{Identity.key(~S,~P,identity),With{}}]}

Uses (13)

Used by (1)