Hi!
I'm quite green so I might have formulated the question wrong.
I'm using a Class called "Cell" to save all the information i need to have about one cell on the map. However a map consists of 250k Cells and therefor I needed a way to create them.
The problem is that the functions used to get/set the Cells don't work unless I declare it in the global (scope?). Therefor I tried to make a class called Map that holds a vector that can contain the Cells. This is my attempt:
It won't compile since it forbids declaration of a vector object without a type. However in the example I am using as a reference I can't find the difference.
Example:(from beginning C++ game programming chapter 9)
Make sure you've declared Cell before you declared Map.
1 2 3 4 5 6 7 8
class Cell
{
//...
};
class Map
{
//...
}
Should work.
The compiler only knows what it's already read, so if you declare Map before declaring Cell, the compiler won't know what Cell is while trying to compile Map.