def resources

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

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

37def resources(~S:Data,plan:Plan.Plan) -> Plan.Recipes(~S,plan) -> Layout.resources(~S,Plan.layout(plan)) -> Plan.Recipes(~S,plan) & (Layout.resources(~S,Plan.layout(plan)) & Saved.Fields):
38  match plan:
39    case Plan.Empty{}:recipe => owner => (recipe,(owner,Saved.empty()))
40    case Plan.Plain{P,V,refresh,key,_}:declaration => owner => retained(Plan.Recipes(~S,plan),Layout.resources(~S,Plan.layout(plan)),declaration,Field.resource(S,P,V,key,Plan.layout(plan),Field.Plain{},owner => (owner,D.Missing{}),owner))
41    case Plan.Transient{P,V,refresh,key,_}:declaration => owner => retained(Plan.Recipes(~S,plan),Layout.resources(~S,Plan.layout(plan)),declaration,Field.resource(S,P,V,key,Plan.layout(plan),Field.Transient{},owner => (owner,D.Missing{}),owner))
42    case Plan.Constructed{P,V,refresh,key,project,access}:declaration => owner => resource_constructed(~S,P,V,refresh,key,project,access,declaration,owner)
43    case Plan.Pair{left,right}:recipe => owner => pair(Plan.Recipes(~S,left),Plan.Recipes(~S,right),Layout.resources(~S,Plan.layout(left)),Layout.resources(~S,Plan.layout(right)),resources(~S,left),resources(~S,right),recipe,owner)

Uses (14)

Used by (1)