public TSLGeneratorCombinator(double probability, GenerateDelegate generateFunc, TSLGeneratorCombinator <R> next = null) { Probability = probability; CumulativeProbability = probability + (next?.CumulativeProbability ?? 0.0); GenerateFunc = generateFunc; NextCombinator = next; }
public static void Generate(GenerateDelegate generator) { if (generator != null) { generator(); } }
static void GenerateWithException(GenerateDelegate method, ICodeBlock codeBlock, IElement element, IPlugin plugin, PluginManager pluginManager) { try { method(codeBlock, element); } catch (Exception e) { PluginContainer pluginContainer = pluginManager.PluginContainers[plugin]; pluginContainer.Fail(e, "Failed during code generation"); } }
public ParticleGenerator(GeneratorAtributes generatorAtributes, GenerateDelegate generateDelegate) { this.generatorAtributes = generatorAtributes; this.generateDelegate = generateDelegate; }
/// <summary> /// Performs world generation asynchronously /// </summary> /// <param name="range">chunks to generate</param> /// <param name="callback">this callback will be called when world will be generated</param> /// <param name="state"></param> public IAsyncResult GenerateAsync(Range3I range, AsyncCallback callback, object state) { var del = new GenerateDelegate(Generate); return(del.BeginInvoke(range, callback, state)); }
public static void Generate(GenerateDelegate generator) { if (generator != null) generator(); }
/// <summary> /// Initializes a new instance of the <see cref="CustomKeyGenerator" /> class. /// </summary> /// <param name="name">The name.</param> /// <param name="generator">The generator.</param> /// <exception cref="ArgumentOutOfRangeException">generator</exception> public CustomKeyGenerator(string name, GenerateDelegate generator) : base(name) => _delegate = generator ?? throw new ArgumentOutOfRangeException(nameof(generator));