oh no, the array is working fine and the command is working fine.
The command visited.push_back( startSquare ); is in one class, ill call that class
There is no problems.
I want to use the same command in another class, ill call that class
the problem is i don't know what i have to do to allow me to use this command in a different class as the array doesnt exist in the B.cpp and i want to use the same array on both A.cpp and B.cpp. If that makes sense?
yeh, but yesterday i made the board generate randomly. Other students are making a staple board and thus can keep it all in one class.
The board is basically completely separate to the AI as far as i can tell. At the moment it goes through walls like a ghost. I want to add some code to the generation of the random walls that includes adding the spaces the walls consume as spaces the AI cannot travel on.
ah but we are not doing proper AI. The way we have coded it, the "AI" simply moves in a random fashion over and over again, then when it ends up in the right place. It takes that specific path and displays it. But each time if it corners itself, it stops and restarts, that space it stopped on becomes a space it will never try to step on again.
I want to make walls those spaces because the walls are purely visual at the moment and have no relation with the AI.
but the board is randomly generated, the walls are never in the same place. I cant alter the AI constructor because that is in A.cpp/.h and the walls generating code is in B.cpp which is basically my initial problem in reverse. :(