def despawn_offset

bendvy-ecs-core@0.1.0.3 · execution_command_publication.bend:101

import bendvy-ecs-core@0.1.0.3/execution_command_publication.bend as ExecutionCommandPublication
import Base
import bendvy-ecs-core@0.1.0.3/execution_lifecycle_notices.bend as Notice
import bendvy-ecs-core@0.1.0.3/world.bend as W
import bendvy-ecs-core@0.1.0.3/entity_allocator.bend as A
import bendvy-ecs-core@0.1.0.3/change_tick.bend as Tick
import bendvy-ecs-core@0.1.0.3/execution_composer_layout.bend as Layout
import bendvy-ecs-core@0.1.0.3/execution_command_buffer.bend as Buffer
import bendvy-ecs-core@0.1.0.3/execution_command_removed.bend as Removed

101def despawn_offset(~S:Data,~R:Type,~E:Data,~layout:Layout.Layout,~route:Layout.Route,store:Layout.columns(~S,layout),remainder:Remainder<S,Layout.columns(~S,layout),R,E>,+handle:W.Handle<S>,allocator:A.Allocator,+tick:Tick.Tick,offset:Maybe<&2,U32>) -> W.World<S,Layout.columns(~S,layout),R,E> & Buffer.Receipt<S,Layout.payload(layout,route),Removed.Removed(layout)>:
102  match remainder offset:
103    case Remainder{namespace,resource,events,pending,registrations,nextSystemId,clock,lifecycle} None{}:(W.World{namespace,allocator,store,resource,events,pending,registrations,nextSystemId,clock,lifecycle},Buffer.DespawnRefused{handle})
104    case remainder Some{offset}:despawn_collected(S,Layout.columns(~S,layout),R,E,Layout.payload(layout,route),Removed.Removed(layout),allocator,remainder,handle,Removed.take(~S,layout)(offset,store),tick,Removed.notices(~S,layout),Notice.append(~S,Notice.Despawned{}))

Uses (20)

Used by (1)