def owner_change

bendvy-ecs-core@0.1.0.4 · world.bend:181

import bendvy-ecs-core@0.1.0.4/world.bend as World
import Base
import entity_key.bend as K
import entity_allocator.bend as A

181def owner_change(~S:Data,~C:Type,~R:Type,~E:Data,release:Bool,+key:K.Key,checked:World<S,C,R,E> & Bool) -> World<S,C,R,E>:
182  match release checked:
183    case _, (world,False{}):world
184    case False{}, (World{namespace,allocator,store,resource,events,pending,registrations,nextSystemId,clock},True{}):World{namespace,A.abandon(allocator,key),store,resource,events,pending,registrations,nextSystemId,clock}
185    case True{}, (World{namespace,allocator,store,resource,events,pending,registrations,nextSystemId,clock},True{}):World{namespace,A.release(allocator,key),store,resource,events,pending,registrations,nextSystemId,clock}

Uses (7)

Used by (2)