private PID CreateActor <T>(string id, Proto.IContext parent, Func <Props> producer) where T : IActor { if (!_registry.RegisteredProps.TryGetValue(typeof(T), out var props)) { props = x => x; } var props2 = props(producer()); if (parent == null) { return(Actor.SpawnNamed(props2, id)); } return(parent.SpawnNamed(props2, id)); }
static PID CreateActor(string id, IContext parent, Func <Props> producer) => parent == null?Actor.SpawnNamed(producer(), id) : parent.SpawnNamed(producer(), id);