def collected
bendvy-ecs-core@0.1.0.4 · reader_domains.bend:35
import bendvy-ecs-core@0.1.0.4/reader_domains.bend as ReaderDomains
import Base
import world.bend as W
import event_runtime.bend as Ev
35
36
37
38def collected(~S: Data,~C: Type,~R: Type,~E: Data,world: W.World<S,C,R,E>,events: Events<S,E>,partition: List<&2,E> & List<&2,E>) -> Detached<S,C,R,E>:
39 match events partition:
40 case Events{+ns,+batches,+positions,+next,+tick,+start,+boundary,+capacity,+dropped,+old}, (+fresh,+removals):
41 +all = Ev.append(~E,old,fresh)
42 detach(~S,~C,~R,~E,Ev.sync_values(~S,~C,~R,~E,(W.events_replace(~S,~C,~R,~E,world,all),all),ns,batches,positions,next,1n+tick,start,boundary,capacity,dropped),removals)