private static Reflector.NamedParam[] GetParams(ref string name, ref SMConstruction method, out Type?myType) { if (!smInitMap.TryGetValue(name, out myType)) { Reflector.NamedParam[]? prms; if (method == SMConstruction.AS_TREFLECTABLE || method == SMConstruction.ANY) { if ((prms = Reflector.TryGetSignature <TTaskPattern>(ref name)) != null) { method = SMConstruction.AS_TREFLECTABLE; return(prms); } } if (method == SMConstruction.AS_REFLECTABLE || method == SMConstruction.ANY) { if ((prms = Reflector.TryGetSignature <TaskPattern>(ref name)) != null) { method = SMConstruction.AS_REFLECTABLE; return(prms); } } } else { return(Reflector.GetConstructorSignature(myType)); } throw new Exception($"{name} is not a StateMachine or applicable auto-reflectable."); }
private static StateMachine Create(string name, SMConstruction method, Type?myType, object[] args) => method switch {