#include<iostream>
#include<vector>
using namespace std;
//initially 9 * 16
#define HEIGHT 9
#define WIDTH 20
class CTile
{
public:
CTile()
{
cout <<"constructor"<<endl;
}
virtual void Ooo()
{
cout<<"base tile : "<<endl;
}
};
class CTile2: public CTile
{
public:
CTile2()
{
cout <<"constructor"<<endl;
}
virtual void Ooo()
{
cout<<" tile 2 virtual : "<<endl;
}
};
int main()
{
CTile * qA;
CTile2 * qA2;
vector<vector<CTile *>> qGame_Screen;
//Set up sizes. (HEIGHT x WIDTH)
qGame_Screen.resize(HEIGHT);
for (int i = 0; i < HEIGHT; i++)
qGame_Screen[i].resize(WIDTH);
//assigning values to array
qGame_Screen[0][0] = qA;
qGame_Screen[0][1] = qA2;
for (int i = 0;i < HEIGHT;i++)
{
for (int j = 1; j < WIDTH; j++)
{
qGame_Screen[i][j] = qA2;
qGame_Screen[i][j]->Ooo();//note array are pointers
}
}
system("PAUSE");
return 0;
}