def live_prepend

bendvy-ecs-core@0.1.0.4 · ordinary_app_hierarchy_query.bend:19

import bendvy-ecs-core@0.1.0.4/ordinary_app_hierarchy_query.bend as OrdinaryAppHierarchyQuery
import Base
import bendvy-ecs-core@0.1.0.4/ordinary_app_relation.bend as Relation
import bendvy-ecs-core@0.1.0.4/world.bend as W

19# Query membership requires a live handle independently of its declaration.
20# Preserve the raw traversal path; this only chooses the query invocation list.
21def live_prepend(~S:Data,~C:Type,~R:Type,~E:Data,selected:Bool,handle:W.Handle<S>,observed:Relation.World(~S,~C,~R,~E) & List<&2,W.Handle<S>>) -> Relation.World(~S,~C,~R,~E) & List<&2,W.Handle<S>>:
22  match selected observed:
23    case True{} Tuple{world,handles}:(world,handle <> handles)
24    case False{} Tuple{world,handles}:(world,handles)

Uses (6)

Used by (1)