diff --git a/lib/src/Simulation.dart b/lib/src/Simulation.dart index bfdfa2c..8342d7c 100644 --- a/lib/src/Simulation.dart +++ b/lib/src/Simulation.dart @@ -43,19 +43,17 @@ class Simulation { _dispersal = dispersal ?? 10; int cx = x ?? rng.nextInt(map.width ~/ 3) + (map.width ~/ 3); int cy = y ?? rng.nextInt(map.height ~/ 3) + (map.height ~/ 3); - switch (pattern) { - default: - int sanityCheck = 0; - for (var i = 0; i < (_amount); i++) { - sanityCheck++; - getCellState(cx, cy) - ? i-- - : setCellState(cx + rng.nextInt(_dispersal), - cy + rng.nextInt(_dispersal), true); - if (sanityCheck > 100 && sanityCheck > i * 3) break; - } - break; + + int sanityCheck = 0; + for (var i = 0; i < (_amount); i++) { + sanityCheck++; + getCellState(cx, cy) + ? i-- + : setCellState( + cx + rng.nextInt(_dispersal), cy + rng.nextInt(_dispersal), true); + if (sanityCheck > 100 && sanityCheck > i * 3) break; } + _dirty = true; }