Fix Snapshot Load and Save Functions
Were just pointers to the map before. Fix to be actual clones of the map.
This commit is contained in:
parent
37bff59f83
commit
2ea974bbd5
2 changed files with 12 additions and 6 deletions
|
|
@ -154,6 +154,10 @@ class Simulation {
|
|||
_dirty = true;
|
||||
}
|
||||
|
||||
void saveSnapshot() => _snapshot = map;
|
||||
Grid<bool> loadSnapshot() => map = _snapshot;
|
||||
void saveSnapshot() => _snapshot = Grid.from(map);
|
||||
Grid<bool> loadSnapshot() {
|
||||
map = Grid.from(_snapshot);
|
||||
_dirty = true;
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue