Esempio n. 1
0
void Board::CommandPlane(int index, enum Command command, int modifier)
{
    for (std::set<Plane *>::iterator it = planesIn.begin(); it != planesIn.end(); ++it)
    {
        Plane *plane = *it;
        if (plane->GetName() == index + 'A')
        {
            if (command == CircleNavaid)
            {
                int x,y;
                navAids[0]->GetPosition(x,y);
                int n1 = plane->dist(x, y);
                navAids[1]->GetPosition(x,y);
                int n2 = plane->dist(x,y);
                if (n1 < n2)
                {
                    navAids[0]->GetPosition(x,y);
                }
                plane->Circle(x, y);
            }
            else
            {
                plane->CommandPlane(command, modifier);
            }
            break;
        }
    }
}