def assigned

bendvy-ecs-core@0.1.0.3 · execution_lifetime_scope_store.bend:25

import bendvy-ecs-core@0.1.0.3/execution_lifetime_scope_store.bend as ExecutionLifetimeScopeStore
import Base
import bendvy-ecs-core@0.1.0.3/lifetime_scope.bend as Scope
import bendvy-ecs-core@0.1.0.3/world.bend as W
import bendvy-ecs-core@0.1.0.3/entity_allocator.bend as Allocator

25def assigned(~S:Data,scope:Scope.Scope<S>,handle:W.Handle<S>,namespace:U32,members:List<&2,Scope.Member>,result:Allocator.Allocator & Bool) -> Allocator.Allocator & (Store<S> & Assignment<S>):
26  match scope handle result:
27    case scope handle, (allocator,False{}):(allocator,(Store{namespace,members},AssignmentRefused{scope,handle,MissingEntity{}}))
28    case Scope.Scope{+scopeNamespace,+name} W.Handle{+handleNamespace,+key}, (allocator,True{}):(allocator,(Store{namespace,List.append(&2,Scope.Member,Scope.without(members,key),[Scope.Member{name,key}])},Assigned{Scope.Scope{scopeNamespace,name},W.Handle{handleNamespace,key}}))

Uses (14)

Used by (1)