-private:
- int GetNeighbors(int i, int j) const;
- inline Cell MakeCell(int i, int j, bool alive) const;
-
- enum CellFlags
- {
- CELL_DEAD = 0x0000, // is dead
- CELL_ALIVE = 0x0001, // is alive
- CELL_MARK = 0x0002, // will change / has changed
- };
+ // navigation
+ LifeCell FindNorth();
+ LifeCell FindSouth();
+ LifeCell FindWest();
+ LifeCell FindEast();
+ LifeCell FindCenter();
+
+ // The following functions find cells within a given viewport; either
+ // all alive cells, or only those cells which have changed since last
+ // generation. You first call BeginFind() to specify the viewport,
+ // then keep calling FindMore() until it returns TRUE.
+ //
+ // BeginFind:
+ // Specify the viewport and whether to look for alive cells or for
+ // cells which have changed since the last generation and thus need
+ // to be repainted. In this latter case, there is no distinction
+ // between newborn or just-dead cells.
+ //
+ // FindMore:
+ // Fills an array with cells that match the specification given with
+ // BeginFind(). The array itself belongs to the Life object and must
+ // not be modified or freed by the caller. If this function returns
+ // FALSE, then the operation is not complete: just process all cells
+ // and call FillMore() again.
+ //
+ void BeginFind(wxInt32 x0, wxInt32 y0,
+ wxInt32 x1, wxInt32 y1,
+ bool changed);
+ bool FindMore(LifeCell *cells[], size_t *ncells);