def install

bendvy-ecs-core@0.1.0.4 · restore_apply.bend:37

import bendvy-ecs-core@0.1.0.4/restore_apply.bend as RestoreApply
import Base
import bendvy-ecs-core@0.1.0.4/change_tick.bend as Tick
import bendvy-ecs-core@0.1.0.4/clock_state.bend as Clock
import bendvy-ecs-core@0.1.0.4/restore_data.bend as R
import bendvy-ecs-core@0.1.0.4/world.bend as W
import bendvy-ecs-core@0.1.0.4/snapshot_data.bend as Snapshot

37def install(~S:Data,~C:Type,~Resources:Type,~E:Data,~State:Type,~Custom:Data,~insert:C -> Resources -> State -> List<&2,R.Binding<S>> -> Tick.Tick -> (C & Resources) & State,state:State,+input:Snapshot.Snapshot,observed:Spawned<S,C,Resources,E>) -> ApplyResult<S,C,Resources,E,State,Custom>:
38  match observed:
39    case Exhausted{world,_}:Refused{world,state,input,capacity_error(~Custom,input)}
40    case Spawned{W.World{namespace,allocator,store,resource,oldEvents,pending,registrations,nextSystem,+clock},+bindings}:inserted(~S,~C,~Resources,~E,~State,~Custom,namespace,allocator,oldEvents,pending,registrations,nextSystem,clock,bindings,insert(store,resource,state,bindings,Clock.current(clock)))

Uses (11)

Used by (1)