Ejemplo n.º 1
0
/*
 * 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;
    
}
Ejemplo n.º 2
0
 /*
  * 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++;
        }
    }
}
Ejemplo n.º 3
0
bool operator!=(Country &c1, Country &c2) {
     return (c1.getCountryName()!=c2.getCountryName());
}