def constructed_with_component

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

import bendvy-ecs-core@0.1.0.4/ordinary_query_declaration.bend as OrdinaryQueryDeclaration
import Base
import bendvy-ecs-core@0.1.0.4/persistence_declaration.bend as Recipe
import bendvy-ecs-core@0.1.0.4/ordinary_declaration.bend as Identity
import bendvy-ecs-core@0.1.0.4/declared_family.bend as Family
import bendvy-ecs-core@0.1.0.4/snapshot_leaf.bend as Leaf
import bendvy-ecs-core@0.1.0.4/decode_data.bend as D
import bendvy-ecs-core@0.1.0.4/compose.bend as Q

65# Constructed-component counterpart of with_component, using the declaration-bound save recipe.
66# take/put must preserve the matching Leaf.Component and all remaining storage.
67# Requires presence without granting payload access.
68def constructed_with_component(~S:Data,~P:Type,~Store:Type,~R:Type,~E:Data,~Rest:Type,~V:Data,~Token:Data,~identity:Identity.Declaration<S,P>,~save:P -> P & D.Raw,~view:P -> P & V,~take:Store -> Rest & Leaf.Component<S,P,identity,save>,~put:Rest -> Leaf.Component<S,P,identity,save> -> Store) -> Declaration<S,Q.Frame<S,Store,R,E>,Unit>:
69  Declaration{Unit{},Q.family_match(~S,~Store,~R,~E,~(Rest & Recipe.Constructed<S,P,identity,save>),~P,~V,~Token,~Family.take_column(~S,~P,~Store,~Rest,~identity,~save,~take),~Family.put_column(~S,~P,~Store,~Rest,~identity,~save,~put),~view,~Family.family(~S,~P,~Store,~Rest,~V,~Token,~identity,~save,~view,~take,~put),~Q.Required{}),[Clause{Identity.key(~S,~P,identity),With{}}]}

Uses (17)

Used by (0)

No other definition uses this definition.