本文整理汇总了C++中Plane::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ Plane::GetName方法的具体用法?C++ Plane::GetName怎么用?C++ Plane::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plane
的用法示例。
在下文中一共展示了Plane::GetName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CommandPlane
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;
}
}
}
示例2: GetDisplayString
std::string Board::GetDisplayString(int index)
{
for (std::set<Plane *>::iterator it = planesIn.begin(); it != planesIn.end(); ++it)
{
Plane *plane = *it;
if (index == plane->GetName() - 'A')
return GetDisplayString(plane);
}
return "";
}
示例3: perform
void perform(HWND hDlg, HWND hList, HWND hEditList,Plane::PlaneDirection direction
//,CountPlanesFunc cpf,LandOrLiftPlanesFunc lolpf,
)
{
Plane * plane = gestor->criarAviaoPara(direction);
ListBox_AddString(hList,plane->GetName());
//_itot_s(cpf(),buffer,sizeof(_TCHAR)*MAX_BUFFER,10);
loadIntoBufferPlanesCount(direction);
Edit_SetText(hEditList,buffer);
plane = executeLandOrListFunction(direction);
EnterCriticalSection(&csDelFromLB);
ListBox_DeleteString(hList,ListBox_FindStringExact(hList,0,plane->GetName()));
LeaveCriticalSection(&csDelFromLB);
//_itot_s(cpf(),buffer,sizeof(_TCHAR)*MAX_BUFFER,10);
loadIntoBufferPlanesCount(direction);
Edit_SetText(hEditList,buffer);
if(!(plane->terminateQuickly()))
{
INT * animationEditTexts = getAnimationEditText(plane->_idLane);
if(plane->GetDirection()==Plane::LAND)
{
for (int i=0; i < 26; ++i) {
doAnimation(plane,hDlg,animationEditTexts[i]);
}
}
else if(plane->GetDirection()==Plane::LIFTOFF)
{
for(int i = 25; i>=0;--i)
{
doAnimation(plane,hDlg,animationEditTexts[i]);
}
}
gestor->libertarPista(plane);
}
}
示例4: GetPlaneIndex
int Board::GetPlaneIndex(int x, int y)
{
x = x/TextWidth;
y = y/TextHeight;
for (std::set<Plane *>::iterator it = planesIn.begin(); it != planesIn.end(); ++it)
{
int x1, y1;
Plane *plane = *it;
plane->GetPosition(x1, y1);
if (x1 == x && y1 == y)
return plane->GetName() - 'A';
}
return -1;
}
示例5: Timed
std::string Board::Timed()
{
std::string rv;
In();
for (std::set<Plane *>::iterator it = planesIn.begin(); it != planesIn.end();)
{
Plane *plane = *it;
int n = plane->GetDestination();
bool atFix;
if (n >= 10)
{
navAids[n-10]->At(*plane);
atFix = airports[n-10]->At(*plane);
if (atFix)
{
if (plane->GetHeading() == airports[n-10]->GetHeading() ^ 4)
{
it = planesIn.erase(it);
planesDone.insert(plane);
continue;
}
}
}
else
{
atFix = fixes[n]->At(*plane);
}
if (plane->GetAltitude() == 0)
{
bool at = false;
int x, y;
int x1, y1;
plane->GetPosition(x, y);
airports[0]->GetPosition(x1,y1);
if (x == x1 && y == y1)
at = true;
airports[1]->GetPosition(x1,y1);
if (x == x1 && y == y1)
at = true;
if (at)
{
rv = "Skimmed airport without landing!";
}
}
if (plane->Move(time))
{
if (atFix && plane->OffBoard())
{
it = planesIn.erase(it);
planesDone.insert(plane);
continue;
}
else if (plane->OffBoard())
{
// game over, exit in wrong place
if (plane->GetAltitude() < 5)
rv = std::string(plane->GetName()) + " left control area at wrong altitude";
else
{
if ((plane->GetDestination() < 10 && plane->GetHeading() != (fixes[plane->GetDestination()]->GetHeading() ^ 4)) ||
(plane->GetDestination() >9 && plane->GetHeading() != (airports[plane->GetDestination()-10]->GetHeading() ^ 4)))
rv = std::string(plane->GetName()) + " left control area at wrong heading";
else
rv = std::string(plane->GetName()) + " left control area at wrong place";
}
}
}
++it;
}
for (std::set<Plane *>::iterator it = planesDisplay.begin(); it != planesDisplay.end();)
{
Plane *plane = *it;
if (plane->GetStartTime() <= time)
{
it = planesDisplay.erase(it);
planesIn.insert(plane);
continue;
}
++it;
}
if (rv == "")
{
for (std::set<Plane *>::iterator it1 = planesIn.begin(); rv == "" && it1 != planesIn.end(); ++it1)
{
Plane *left = *it1;
for (std::set<Plane *>::iterator it2 = it1; rv == "" && it2 != planesIn.end(); ++it2)
{
Plane *right = *it2;
if (it1 != it2)
{
if (left->GetAltitude() == right->GetAltitude())
{
int x,y;
right->GetPosition(x, y);
if (left->dist(x, y) < 4)
rv = std::string("Conflict between ") + left->GetName() + " and " + right->GetName();
}
}
}
}
//.........这里部分代码省略.........