def enqueue_list

bendvy-ecs-core@0.1.0.4 · commands.bend:8

import bendvy-ecs-core@0.1.0.4/commands.bend as Commands
import Base
import bendvy-ecs-core@0.1.0.4/deferred_command.bend as Deferred
import bendvy-ecs-core@0.1.0.4/world.bend as W

8# World pending commands are a reverse accumulator; input here is FIFO.
9def enqueue_list(~S: Data,~C: Type,~R: Type,~E: Data,commands:List<Deferred.Command<W.World<S,C,R,E>>>,world: W.World<S,C,R,E>) -> W.World<S,C,R,E>:
10  match commands:
11    case []: world
12    case command <> rest: enqueue_list(~S,~C,~R,~E,rest,W.enqueue_command(~S,~C,~R,~E,world,command))

Uses (4)

Used by (1)