当前位置: 首页>>代码示例>>C++>>正文


C++ Plane::GetName方法代码示例

本文整理汇总了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;
        }
    }
}
开发者ID:bencz,项目名称:OrangeC,代码行数:28,代码来源:DisplayObjects.cpp

示例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 "";
}
开发者ID:bencz,项目名称:OrangeC,代码行数:10,代码来源:DisplayObjects.cpp

示例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);
	}
}
开发者ID:masterzdran,项目名称:semestre5,代码行数:40,代码来源:Trab2.cpp

示例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;
}
开发者ID:bencz,项目名称:OrangeC,代码行数:14,代码来源:DisplayObjects.cpp

示例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();
                    }
                }
            }
        }
//.........这里部分代码省略.........
开发者ID:bencz,项目名称:OrangeC,代码行数:101,代码来源:DisplayObjects.cpp


注:本文中的Plane::GetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。