def components

bendvy-ecs-core@0.1.0.3 · execution_save_traversal.bend:30

import bendvy-ecs-core@0.1.0.3/execution_save_traversal.bend as ExecutionSaveTraversal
import Base
import bendvy-ecs-core@0.1.0.3/execution_save_plan.bend as Plan
import bendvy-ecs-core@0.1.0.3/execution_save_layout_field.bend as Field
import bendvy-ecs-core@0.1.0.3/execution_save_data.bend as Saved
import bendvy-ecs-core@0.1.0.3/execution_composer_layout.bend as Layout
import bendvy-ecs-core@0.1.0.3/decode_data.bend as D

30def components(~S:Data,plan:Plan.Plan) -> Plan.Recipes(~S,plan) -> U32 -> Layout.columns(~S,Plan.layout(plan)) -> Plan.Recipes(~S,plan) & (Layout.columns(~S,Plan.layout(plan)) & Saved.Fields):
31  match plan:
32    case Plan.Empty{}:recipe => id => owner => (recipe,(owner,Saved.empty()))
33    case Plan.Plain{P,V,refresh,key,_}:declaration => id => owner => retained(Plan.Recipes(~S,plan),Layout.columns(~S,Plan.layout(plan)),declaration,Field.component(S,P,V,key,Plan.layout(plan),Field.Plain{},owner => (owner,D.Missing{}),owner,id))
34    case Plan.Transient{P,V,refresh,key,_}:declaration => id => owner => retained(Plan.Recipes(~S,plan),Layout.columns(~S,Plan.layout(plan)),declaration,Field.component(S,P,V,key,Plan.layout(plan),Field.Transient{},owner => (owner,D.Missing{}),owner,id))
35    case Plan.Constructed{P,V,refresh,key,project,access}:declaration => id => owner => component_constructed(~S,P,V,refresh,key,project,access,declaration,id,owner)
36    case Plan.Pair{left,right}:recipe => id => owner => component_pair(Plan.Recipes(~S,left),Plan.Recipes(~S,right),Layout.columns(~S,Plan.layout(left)),Layout.columns(~S,Plan.layout(right)),components(~S,left),components(~S,right),recipe,id,owner)

Uses (15)

Used by (1)