diff --git a/lib/src/Engine.dart b/lib/src/Engine.dart index b06e53a..84d52e8 100644 --- a/lib/src/Engine.dart +++ b/lib/src/Engine.dart @@ -1,7 +1,7 @@ import 'dart:html' as html; import 'dart:math'; -import 'package:rules_of_living/src/Grid.dart'; +import 'package:rules_of_living/src/Simulation.dart'; class Engine { // Elapsed Time Counter - useful for Safety Timeout @@ -36,7 +36,7 @@ class Engine { void set gridSize(Point value) { if (value.x <= 0 || value.y <= 0) throw ArgumentError("grid size must not be smaller than 1"); - _grid = Grid(value.x, value.y); + _grid = Simulation(value.x, value.y); } num _updateLag = 0.0; @@ -48,11 +48,11 @@ class Engine { /// be used if no canvas was defined at engine creation and it should be /// rendered later. html.CanvasElement canvas; - Grid _grid; + Simulation _grid; bool running = false; Engine([x = 100, y = 100, this.canvas]) { - _grid = Grid(x, y); + _grid = Simulation(x, y); _elapsed.start(); _grid.addPattern(amount: 15, dispersal: 5); @@ -70,7 +70,7 @@ class Engine { } void clear() { - _grid = new Grid(gridSize.x, gridSize.y); + _grid = new Simulation(gridSize.x, gridSize.y); running = false; } diff --git a/lib/src/Grid.dart b/lib/src/Simulation.dart similarity index 99% rename from lib/src/Grid.dart rename to lib/src/Simulation.dart index d95c25e..3b2c559 100644 --- a/lib/src/Grid.dart +++ b/lib/src/Simulation.dart @@ -6,7 +6,7 @@ import 'package:rules_of_living/src/Rule.dart'; enum CellPattern { SpaceShip, Blinker } -class Grid { +class Simulation { final int w; final int h; final List> map; @@ -21,7 +21,7 @@ class Grid { int _dispersal; CellPattern _pattern; - Grid(int w, int h) + Simulation(int w, int h) : this.w = w, this.h = h, this.map = new List() {