def column_take
bendvy-ecs-core@0.1.0.3 · execution_composer_layout.bend:129
import bendvy-ecs-core@0.1.0.3/execution_composer_layout.bend as ExecutionComposerLayout
import Base
import bendvy-ecs-core@0.1.0.3/chunk_column.bend as Column
import bendvy-ecs-core@0.1.0.3/owner_product.bend as Product
129def column_take(~S:Data,layout:Layout,route:Route,owner:columns(~S,layout)) -> column_rest(~S,layout,route) & ColumnSlot<S,stored(layout,route),key(layout,route),origin(layout,route)>:
130 match layout route owner:
131 case EmptyLayout{} _ owner:(owner,ColumnSlot{Column.empty(~S,~Viewed<Unit,Unit>)})
132 case LayoutLeaf{P,V,_,key,_} AtLeaf{} owner:(Unit{},owner)
133 case ClassifiedLayoutLeaf{P,V,_,key,_,_} AtLeaf{} owner:(Unit{},owner)
134 case LayoutLeaf{P,V,_,key,_} InLeft{_} owner:(owner,ColumnSlot{Column.empty(~S,~Viewed<Unit,Unit>)})
135 case ClassifiedLayoutLeaf{P,V,_,key,_,_} InLeft{_} owner:(owner,ColumnSlot{Column.empty(~S,~Viewed<Unit,Unit>)})
136 case LayoutLeaf{P,V,_,key,_} InRight{_} owner:(owner,ColumnSlot{Column.empty(~S,~Viewed<Unit,Unit>)})
137 case ClassifiedLayoutLeaf{P,V,_,key,_,_} InRight{_} owner:(owner,ColumnSlot{Column.empty(~S,~Viewed<Unit,Unit>)})
138 case LayoutPair{left,right} AtLeaf{} owner:(owner,ColumnSlot{Column.empty(~S,~Viewed<Unit,Unit>)})
139 case LayoutPair{left,right} InLeft{rest} Product.Owner{l,r}:column_joined(~S,stored(left,rest),key(left,rest),origin(left,rest),columns(~S,right),column_rest(~S,left,rest),r,column_take(~S,left,rest,l))
140 case LayoutPair{left,right} InRight{rest} Product.Owner{l,r}:column_joined(~S,stored(right,rest),key(right,rest),origin(right,rest),columns(~S,left),column_rest(~S,right,rest),l,column_take(~S,right,rest,r))