def preceding
bendvy-ecs-core@0.1.0.4 · bundle_batch.bend:63
import bendvy-ecs-core@0.1.0.4/bundle_batch.bend as BundleBatch
import Base
import bendvy-ecs-core@0.1.0.4/deferred_command.bend as Deferred
import transaction.bend as T
63
64
65def preceding(~World:Type,~E:Data,count:Nat,commands:List<Deferred.Command<World>>,tx:T.Tx<World,E>) -> List<Deferred.Command<World>> & T.Tx<World,E>:
66 match count commands:
67 case 0n _: (commands,tx)
68 case 1n+rest Nil{}: ([],tx)
69 case 1n+rest Con{command,tail}: preceding(~World,~E,rest,tail,T.stage_command(~World,~E,tx,command))