def register_checked

bendvy-ecs-core@0.1.0.3 · execution_event_family.bend:68

import bendvy-ecs-core@0.1.0.3/execution_event_family.bend as ExecutionEventFamily
import Base
import bendvy-ecs-core@0.1.0.3/owned_event_log.bend as Log

68def register_checked(~S:Data,~P:Type,~key:String,start:Start,available:Bool,family:Family<S,P,key>) -> Family<S,P,key> & Registration<S,P,key>:
69  match available family:
70    case False{} family:(family,RegistrationRefused{ReaderLimit{}})
71    case True{} Family{+identity,open,Log.Log{+next,rows},previous,current,+nextReader,active,dropped}:(Family{identity,open,Log.Log{next,rows},previous,current,U32.add(nextReader,1),List.append(&2,U32,active,[nextReader]),dropped},Registered{Reader{identity,nextReader,starting(start,next)}})

Uses (15)

Used by (1)