def take_column

bendvy-ecs-core@0.1.0.4 · ordinary_lifetime_scope.bend:146

import bendvy-ecs-core@0.1.0.4/ordinary_lifetime_scope.bend as OrdinaryLifetimeScope
import Base
import bendvy-ecs-core@0.1.0.4/lifetime_scope.bend as Sc
import bendvy-ecs-core@0.1.0.4/relation_commands.bend as A
import bendvy-ecs-core@0.1.0.4/column.bend as Col

146# Trusted schema projection: take one component column through scope/relation
147# wrappers, returning ComponentRest with every sibling and metadata owner.
148# Pair it with put_column from the same original store projection.
149def take_column(~S:Data,~C:Type,~Rest:Type,~P:Type,~take:C -> Rest & Col.Column<S,P>,store:A.Store<S,Sc.Store<S,C>>) -> ComponentRest<S,Rest> & Col.Column<S,P>:
150  match store:
151    case A.Store{Sc.Store{components,members},graph}:taken_column(~S,~C,~Rest,~P,members,graph,take(components))

Uses (6)

Used by (1)