Add return of new cell state to advanceState Function

This commit is contained in:
Marty Oehme 2018-07-08 19:08:40 +02:00
parent 3676264444
commit 9fb67d0194
1 changed files with 5 additions and 1 deletions

View File

@ -11,11 +11,15 @@ class Cell {
Cell([bool state = false]) : this.state = state;
void advanceState() {
// Sets the actual state to what it should be next update
// Returns the newly assumed actual state of the cell.
bool advanceState() {
this.state = this.nextState;
this.nextState = false;
this.dirty = true;
return this.state;
}
void update(int neighbors) {