def enqueue_packet

bendvy-ecs-core@0.1.0.4 · decode_requests.bend:36

import bendvy-ecs-core@0.1.0.4/decode_requests.bend as DecodeRequests
import Base
import bendvy-ecs-core@0.1.0.4/bundle_batch.bend as Batch
import bendvy-ecs-core@0.1.0.4/bundle_requests.bend as Commands
import bendvy-ecs-core@0.1.0.4/decode_data.bend as D
import bendvy-ecs-core@0.1.0.4/persistence_declaration.bend as Decl
import bendvy-ecs-core@0.1.0.4/ordinary_declaration.bend as Identity

36def enqueue_packet(~S:Data,~C:Type,~R:Type,~E:Data,~P:Type,~identity:Identity.Declaration<S,P>,~project:P -> P & D.Raw,declaration:Decl.Constructed<S,P,identity,project>,batch:Batch.Batch<S,C,R,E,Packet<P>>,operation:Commands.Operation<S>,owner:P,original:D.Raw,+canonical:D.Raw) -> Owner<S,C,R,E,P,identity,project> & Output<S,P>:
37  match operation:
38    case Commands.Insert{+target}:inserted(~S,~C,~R,~E,~P,~identity,~project,declaration,target,canonical,Batch.insert(~S,~C,~R,~E,~Packet<P>,batch,target,Packet{Some{owner},original,canonical}))
39    case Commands.Spawn{}:spawned(~S,~C,~R,~E,~P,~identity,~project,declaration,canonical,Batch.spawn(~S,~C,~R,~E,~Packet<P>,batch,Packet{Some{owner},original,canonical}))

Uses (14)

Used by (1)