/* * Takes a Country as an argument and determines if it is adjacent to this one. */ bool Country::isAdjacent(Country othercountry) { for (int i=0;i<100;i++) { if(this->adjacent[i]==othercountry.getCountryName()) { return true; } if (this->adjacent[i]=="") { return false; } } return false; }
/* * Takes a Country as an argument and sets that country to be adjacent to the this one. */ void Country::addAdjacent(Country othercountry) { int i=0; while (i !=-1) { if (this->adjacent[i]=="") { this->adjacent[i]=othercountry.getCountryName(); i=-1; } else { i++; } } }
bool operator!=(Country &c1, Country &c2) { return (c1.getCountryName()!=c2.getCountryName()); }