private void Step_Click(object sender, EventArgs e) { if (((Button)sender).Tag is GenerationStep) { var step = (GenerationStep)((Button)sender).Tag; gen.Generate(step + 1); } else { gen.Generate(); if (ras == null) { ras = new Rasterizer(seed, gen.ExportGraph()); } var step = (RasterizationStep)((Button)sender).Tag; ras.Rasterize(step + 1); } Render(); foreach (var btn in btns) { if (btn.Tag is GenerationStep) { btn.Enabled = (GenerationStep)btn.Tag >= gen.Step; } else { btn.Enabled = ras == null || (RasterizationStep)btn.Tag >= ras.Step; } } }
public void GenerateAsync() { gen.Generate(); if (ras == null) { ras = new Rasterizer(seed, gen.ExportGraph()); } ras.Rasterize(); }
public void GenerateAsync() { _gen.Generate(); if (_ras == null) { _ras = new Rasterizer(_seed, _gen.ExportGraph()); } _ras.Rasterize(); }