having this issue with Country or Continent not being identified in the following code for the Map.h file
Map.h:
#ifndef MAP_H
#define MAP_H
#include<string>
#include<vector>
#include<iostream>
#include<fstream>
//#include "Country.h"
using namespace std;
class Map{
private:
vector<Country> countries;
vector<Continent> continents;
vector<vector<int> > adjacents;
string author;
string image;
string wrap;
string scroll;
string warn;
public:
Map(ifstream);
Map();
void save();
void setAdjacent(Country&, Country&);
void placeWithin(Continent&, Country&);
int numOfCountries();
int numOfContinents();
bool verify();
bool isAdjacent(Country*, Country&);
bool hasAdjacent(Country*);
bool hasCountry(Continent&);
};
#endif
Whether add in the commented out include, i still get the error.
Here are the other two files
Continent.h:
#ifndef CONTINENT_H
#define CONTINENT_H
#include "Map.h"
using namespace std;
class Continent
{
private:
string name;
int bonus;
vector<Country> countries;
public:
void addCountry(Country&);
int getOwner();
int getBonus();
int getSize();
string getName();
bool hasCountry(Country&);
};
#endif
Country.h:
#ifndef COUNTRY_H
#define COUNTRY_H
#include "Continent.h"
using namespace std;
class Country{
private:
static int nextCountryNumber;
int countryNumber;
Map map;
string name;
int x, y;
Continent continent;
vector<Country> adjacents;
public:
Country(string, int, int, Continent&, Map&);
string getName();
int getX();
int getY();
Continent getContinent();
bool isAdjacentTo(Country&);
bool hasAdjacent();
void addAdjacent(Country&);
string toString();
};
#endif
I think its some sort of circular referencing but I cant find where that is the case...