def register_checked

bendvy-ecs-core@0.1.0.3 · world.bend:289

import bendvy-ecs-core@0.1.0.3/world.bend as World
import Base

289def register_checked(~S: Data,~C: Type,~R: Type,~E: Data,available: Bool,world: World<S,C,R,E>,+name: String,+access: List<&2,String>) -> World<S,C,R,E> & Registration:
290  match available world:
291    case False{} world: (world,RegistrationRejected{SystemIdExhausted{}})
292    case True{} World{+namespace,allocator,store,resource,+events,pending,+registrations,+nextSystemId,+clock,lifecycle}: (World{namespace,allocator,store,resource,events,pending,RegistrationMeta{nextSystemId,name,access} <> registrations,(nextSystemId + 1 : U32),clock,lifecycle},Registered{nextSystemId})

Uses (11)

Used by (1)