public static ScriptObject Create(Random random) { var language = new TemplateLanguage(); var so = new ScriptObject(); AddMethods(random, so); so.Import(language); var substitutionValues = GenerateLiteralSubstitutions(random) .Concat(NumericalSubstitutions.SelectMany(kv => Range(1, 5) .Select(i => ($"{kv.Key}{i}", kv.Value(random))))); foreach (var(substitution, value) in substitutionValues) { so.Add(substitution, value); } return(so); }
public static ScriptObject CreateScriptObject(Random random) { return(TemplateLanguage.Create(random)); }