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


C++ IshipIGC::SetCommand方法代码示例

本文整理汇总了C++中IshipIGC::SetCommand方法的典型用法代码示例。如果您正苦于以下问题:C++ IshipIGC::SetCommand方法的具体用法?C++ IshipIGC::SetCommand怎么用?C++ IshipIGC::SetCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IshipIGC的用法示例。


在下文中一共展示了IshipIGC::SetCommand方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: LoadUniverse

//------------------------------------------------------------------------------
void        Mission4::CreateUniverse (void)
{
    LoadUniverse ("training_3", 486, 1030);    // an advanced stealth fighter

    // stuff for setup
    IshipIGC*           pShip = trekClient.GetShip();

    // set a global attribute to increase the overall energy of the ship
    IsideIGC*           pSide = pShip->GetSide ();
    GlobalAttributeSet  gas = pSide->GetGlobalAttributeSet ();
    gas.SetAttribute (c_gaMaxEnergy, 10.0f);
    pSide->SetGlobalAttributeSet (gas);

    // put the commander ship in the station
    ImissionIGC*        pCore = trekClient.GetCore();
    ImodelIGC*          pStation = pCore->GetModel (OT_station, 1030);
    IshipIGC*           pCommander = pCore->GetShip (m_commanderID);
    pCommander->SetStation (static_cast<IstationIGC*> (pStation));
    pCommander->SetCommand (c_cmdAccepted, NULL, c_cidDoNothing);
    pCommander->SetCommand (c_cmdCurrent, NULL, c_cidDoNothing);
    pCommander->SetAutopilot (false);

    // activate all the starting weapons
    trekClient.fGroupFire = true;

    // take the missiles off the ship
    IpartIGC*           pPart = pShip->GetMountedPart (ET_Magazine, 0);
    if (pPart)
        pPart->Terminate ();

}
开发者ID:borgified,项目名称:Allegiance,代码行数:32,代码来源:mission4.cpp

示例2: LoadUniverse

    //------------------------------------------------------------------------------
    void        Mission5::CreateUniverse (void)
    {
        LoadUniverse ("training_5", 412, 1050);    // an intercepter

        // put the commander ship in the station
        ImissionIGC*    pCore = trekClient.GetCore();
        ImodelIGC*      pStation = pCore->GetModel (OT_station, 1050);
        IshipIGC*       pCommander = pCore->GetShip (m_commanderID);
        pCommander->SetStation (static_cast<IstationIGC*> (pStation));
        pCommander->SetCommand (c_cmdAccepted, NULL, c_cidDoNothing);
        pCommander->SetCommand (c_cmdCurrent, NULL, c_cidDoNothing);
        pCommander->SetAutopilot (false);
    }
开发者ID:borgified,项目名称:Allegiance,代码行数:14,代码来源:mission5.cpp

示例3: LoadUniverse

    //------------------------------------------------------------------------------
    void        Mission6::CreateUniverse (void)
    {
        LoadUniverse ("training_3", 488, 1030);    // a fighter 3

        // activate all the starting weapons
        trekClient.fGroupFire = true;

        // put the commander ship in the station
        ImissionIGC*    pCore = trekClient.GetCore();
        ImodelIGC*      pStation = pCore->GetModel (OT_station, 1030);
        IshipIGC*       pCommander = pCore->GetShip (m_commanderID);
        pCommander->SetStation (static_cast<IstationIGC*> (pStation));
        pCommander->SetCommand (c_cmdAccepted, NULL, c_cidDoNothing);
        pCommander->SetCommand (c_cmdCurrent, NULL, c_cidDoNothing);
        pCommander->SetAutopilot (false);
    }
开发者ID:borgified,项目名称:Allegiance,代码行数:17,代码来源:mission6.cpp

示例4: GetWindow

    //------------------------------------------------------------------------------
    void        SetCommandAction::Execute (void)
    {
        // get a pointer to the actual ship and the target
        IshipIGC*   pShip = static_cast<IshipIGC*> (static_cast<ImodelIGC*> (*m_pShip));
        ImodelIGC*  pTarget = static_cast<ImodelIGC*> (*m_pTarget);

        // the ship might not be there for any of a hundred reasons,
        // including that it was destroyed. If it's not there, we want
        // to skip setting its command.
        if (pShip)
        {
            // we want to use the pretty interface if this is a command for the player
            if ((pShip == trekClient.GetShip ()) and (m_command == c_cmdQueued))
            {
                TrekWindow* pWindow = GetWindow ();
                IshipIGC*   pCommander = g_pMission->GetCommanderShip ();
                ZString     strOrder = ZString (c_cdAllCommands[m_commandID].szVerb);
                if (pTarget)
                    strOrder = strOrder + " " + GetModelName (pTarget);
                pWindow->SetQueuedCommand (pCommander, m_commandID, pTarget);
                trekClient.PostText(true, "New orders from %s to %s: %s. Press [insert] to accept.", (const char*)GetModelName (pCommander), GetModelName (pShip), (const char*) strOrder);
            }
            else
                pShip->SetCommand (m_command, pTarget, m_commandID);
        }
    }
开发者ID:FreeAllegiance,项目名称:Allegiance-R7-With-R4-Engine,代码行数:27,代码来源:setcommandaction.cpp


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