def insert_offset
bendvy-ecs-core@0.1.0.3 · execution_command_publication.bend:51
import bendvy-ecs-core@0.1.0.3/execution_command_publication.bend as ExecutionCommandPublication
import Base
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/chunk_column.bend as Column
import bendvy-ecs-core@0.1.0.3/execution_command_buffer.bend as Buffer
51def insert_offset(~S:Data,~layout:Layout.Layout,~route:Layout.Route,allocator:A.Allocator,column:Column.Column<S,Layout.stored(layout,route)>,+handle:W.Handle<S>,incoming:Layout.payload(layout,route),tick:Tick.Tick,offset:Maybe<&2,U32>) -> Applied<S,layout,route>:
52 match offset:
53 case None{}:Applied{allocator,column,Buffer.Refused{handle,Some{incoming}},False{}}
54 case Some{+offset}:swapped(~S,~layout,~route,allocator,handle,Column.swap_at(~S,~(Layout.stored(layout,route)),Column.ensure(~S,~(Layout.stored(layout,route)),column,U32.add(offset,1)),offset,Some{Layout.initialize(layout,route,incoming)},tick),False{})