def target_edges_erased

bendvy-ecs-core@0.1.0.3 · relation_graph.bend:28

import bendvy-ecs-core@0.1.0.3/relation_graph.bend as RelationGraph
import Base
import entity_key.bend as K
import relation_types.bend as T

28def target_edges_erased(-S: Data,edges: List<&2,T.Edge<S>>,+descriptor: T.Descriptor<S>,+source: K.Key) -> Maybe<&2,K.Key>:
29  match edges:
30    case []: None{}
31    case T.Edge{other,id,target} <> rest: chosen_target(Bool.and(U32.is_eq(key_erased(S,other),key_erased(S,descriptor)),K.equal(id,source)),target,_ => target_edges_erased(S,rest,descriptor,source))

Uses (10)

Used by (5)