I am trying to translate Daniel Shiffman’s game of life from processing to oF. I am using a vector of vectors in place of Processing’s 2d arrays. I am getting the following error in the Vector.h file when I try to build: “No matching structure for initialisation of ‘value type’ (aka cell)”.
Here is my cell.h file:
class cell {
public:
cell(int _x, int _y, int _w);
//cell();
void savePrevious();
void newState(int s);
void display();
int x;
int y;
int w;
int state;
int previous;
};
I think the error arises as a result of how I call my cell class in the GoL class header:
class GoL {
public:
GoL();
void init();
void generate();
void display();
void run();
int w = 8;
int cols;
int rows;
std::vector<vector<cell> > board;
};
Can someone let me know if this is the correct way to set up the vector of cells?
Thanks.