#include "Graph.h"
#include "Graphics.h"
#include "MainWindow.h"
#include "SnakeGoal.h"
typedef struct {
std::pair<double, double> coordinates; //x, y
int direction;
}directionChange;
class Snake {
private:
std::pair<double, double> coordinates;
std::deque<directionChange> direcChanges; //a deque of direction
std::deque<Snake> body; //the body of the snake
int direction;
The deque objects are causing a chain reaction of errors. It says
use of undefined type 'Snake' (compiling source file Snake.cpp
)
Am i not allowed to have a deque object of my class type here? If not, what is the right way to do this? It is working just fine on onlinegdb.ocom