def relations

bendvy-ecs-core@0.1.0.4 · restore_graph_save.bend:21

import bendvy-ecs-core@0.1.0.4/restore_graph_save.bend as RestoreGraphSave
import Base
import bendvy-ecs-core@0.1.0.4/restore_graph_data.bend as R
import bendvy-ecs-core@0.1.0.4/relation_types.bend as G
import bendvy-ecs-core@0.1.0.4/relation_graph.bend as Graph
import bendvy-ecs-core@0.1.0.4/relation_failure_reader.bend as Ordinary

21def relations(~S:Data,declarations:List<&2,Ordinary.Declaration<S>>,+graph:G.Graph<S>) -> List<&2,R.Relation>:
22  match declarations graph:
23    case [] _:[]
24    case Ordinary.Declaration{+descriptor} <> rest G.Graph{+edges,+inverses}:R.Relation{Graph.name(~S,descriptor),groups(~S,inverses,descriptor)} <> relations(~S,rest,G.Graph{edges,inverses})

Uses (6)

Used by (1)