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


C++ setAction函数代码示例

本文整理汇总了C++中setAction函数的典型用法代码示例。如果您正苦于以下问题:C++ setAction函数的具体用法?C++ setAction怎么用?C++ setAction使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: setAction

void CArachnut::getTouchedBy(CSpriteObject &theObject)
{
    if( theObject.dead )
        return;

    if( CBullet *bullet = dynamic_cast<CBullet*>(&theObject) )
    {
        bullet->setAction(A_KEENSHOT_IMPACT);
        bullet->playSound( SOUND_SHOT_HIT );
        setAction(A_ARACHNUT_STUNNED);
    }

    if( CPlayerBase *player = dynamic_cast<CPlayerBase*>(&theObject) )
    {
        player->kill();
    }
}
开发者ID:pelya,项目名称:Commander-Genius,代码行数:17,代码来源:CArachnut.cpp

示例2: moveDope

void CDopeFish::processEat()
{
	moveDope(DOPE_BITE_SPEED);

	if(m_eatTimer>0)
	{
		m_eatTimer--;
	}
	else
	{
		m_eatTimer = 0;
		setAction(A_DOPEFISH_START_BURP);

		m_burped = false;
		mp_processState = &CDopeFish::processBurp;
	}
}
开发者ID:alicecola31,项目名称:Commander-Genius,代码行数:17,代码来源:CDopeFish.cpp

示例3: QWidget

UASActionsWidget::UASActionsWidget(QWidget *parent) : QWidget(parent)
{
    QLOG_INFO() << "UASActionsWidget creating " << this;
    m_uas = NULL;
    ui.setupUi(this);
    connect(ui.changeAltitudeButton,SIGNAL(clicked()),this,SLOT(changeAltitudeClicked()));
    connect(ui.changeSpeedButton,SIGNAL(clicked()),this,SLOT(changeSpeedClicked()));
    connect(ui.goToWaypointButton,SIGNAL(clicked()),this,SLOT(goToWaypointClicked()));
    connect(ui.armDisarmButton,SIGNAL(clicked()),this,SLOT(armButtonClicked()));
    connect(UASManager::instance(),SIGNAL(activeUASSet(UASInterface*)),this,SLOT(activeUASSet(UASInterface*)));

    if (UASManager::instance()->getActiveUAS())
    {
        activeUASSet(UASManager::instance()->getActiveUAS());
    }

    // Setup Action Combo Box
    ui.actionComboBox->addItem("Loiter Unlimited", MAV_CMD_NAV_LOITER_UNLIM);
    ui.actionComboBox->addItem("Return To Launch", MAV_CMD_NAV_RETURN_TO_LAUNCH);
    ui.actionComboBox->addItem("Preflight Calibration", MAV_CMD_PREFLIGHT_CALIBRATION);
    ui.actionComboBox->addItem("Mission Start", MAV_CMD_MISSION_START);
    ui.actionComboBox->addItem("Preflight Reboot", MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN);

    connect(ui.exeActionButton, SIGNAL(clicked()),
            this, SLOT(setAction()));

    // Mode Shortcut Buttons
    connect(ui.autoModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.stabilizeModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.rtlModeButton, SIGNAL(clicked()),
            this, SLOT(setRTLMode()));
    connect(ui.loiterModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));

    connect(ui.opt1ModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.opt2ModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.opt3ModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.opt4ModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
}
开发者ID:francisvierboom,项目名称:apm_planner,代码行数:45,代码来源:UASActionsWidget.cpp

示例4: init

bool Unit::init()
{
	if (_unitDefiniation)
	{
		std::string csb = _unitDefiniation->getName();
		cocos2d::Node * node = cocos2d::CSLoader::createNode(csb);
		cocostudio::timeline::ActionTimeline * action = cocos2d::CSLoader::createTimeline(csb);

		if (node) setEntry(node);
		if (action) setAction(action);

		if (node && action)
		{
			node->runAction(action);
		}
	}
	return true;
}
开发者ID:spzktshow,项目名称:OriginArt,代码行数:18,代码来源:OGUnit.cpp

示例5: UndoEventData

void CreateNewEventCommand::redo()
{
  if (mpEventData == NULL)
    {
      mpEventWidget->createNewEvent();

      std::string sName = mpEventWidget->mpEvent->getObjectName();
      mpEventData = new UndoEventData(mpEventWidget->mpEvent);
      setName(sName);
    }
  else
    {
      mpEventWidget->addEvent(mpEventData);
    }

  setUndoState(true);
  setAction("Create");
}
开发者ID:jonasfoe,项目名称:COPASI,代码行数:18,代码来源:CreateNewEventCommand.cpp

示例6: moveRight

void CBobba::processJumping()
{
	// Move normally in the direction
	if( xDirection == RIGHT )
	{
		moveRight( MOVE_X_SPEED );
	}
	else
	{
		moveLeft( MOVE_X_SPEED );
	}
	
	if(blockedd && yinertia >= 0)
	{
	    setAction(A_BOBBA_SIT);
	    playSound(SOUND_BOBBA_LAND);
	}
}
开发者ID:FromCrimsonToWool,项目名称:Commander-Genius,代码行数:18,代码来源:CBobba.cpp

示例7: QModelIndex

void insertReactionRowsCommand::redo()
{
  mpReactionDM->insertNewReactionRow(mPosition, mRows, QModelIndex());
  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
  CCopasiDataModel* pDataModel = (*CCopasiRootContainer::getDatamodelList())[0];
  assert(pDataModel != NULL);
  CModel * pModel = pDataModel->getModel();
  assert(pModel != NULL);
  mpReaction = pModel->getReactions()[mPosition];
  std::string sName = mpReaction->getObjectName();
  mpReactionData->setName(sName);
  CReactionInterface* ri = new CReactionInterface((*CCopasiRootContainer::getDatamodelList())[0]->getModel());
  ri->initFromReaction(mpReaction);
  mpReactionData->setRi(ri);
  setUndoState(true);
  setAction("Add to list");
  setName(mpReactionData->getName());
}
开发者ID:bmoreau,项目名称:COPASI,代码行数:18,代码来源:insertReactionRowsCommand.cpp

示例8: uploadProgress

void TTRssFetcher::finishedSetAction()
{
    if (!processResponse()) {
        return;
    }

    auto db = DatabaseManager::instance();

    DatabaseManager::Action action = actionsList.takeFirst();
    db->removeActionsByIdAndType(action.id1, action.type);

    emit uploadProgress(uploadProggressTotal - actionsList.size(), uploadProggressTotal);

    if (actionsList.isEmpty()) {
        startFetching();
    } else {
        setAction();
    }
}
开发者ID:mkiol,项目名称:kaktus,代码行数:19,代码来源:ttrssfetcher.cpp

示例9: QAction

void MenuButton::setAction(const QString & name)
{
  if (actionName() == name)
    return;

  if (_guiClientInterface)
  {
    QAction *action = _guiClientInterface->findAction(name);
    if (!action)
    {
      // Create one so property can be saved.  Maybe gui client
      // action name provided will be valid in another instance.
      action = new QAction(this);
      action->setObjectName(name);
      action->setEnabled(false);
    }
    setAction(action);
  }
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:19,代码来源:menubutton.cpp

示例10: setAction

void CBobba::processSitting()
{
    mTimer++;

    if(mTimer < SIT_TIME)
	return;
    
    mTimer = 0;
    
    setAction(A_BOBBA_SHOOT);
    playSound(SOUND_BOBBA_SHOOT);    
    int x_coord = getXMidPos();
    x_coord += (xDirection == LEFT) ? -(8<<STC) : +(8<<STC);
    
    CEnemyShot *fireball = new CEnemyShot(mp_Map, 0, x_coord, getYUpPos(),
                       0x2E76, xDirection, 0,  100, mSprVar);
    spawnObj( fireball );
    
}
开发者ID:FromCrimsonToWool,项目名称:Commander-Genius,代码行数:19,代码来源:CBobba.cpp

示例11: switch

void MenuButton::actionEvent(QActionEvent *event)
{
    QAction *action = event->action();
    switch (event->type())
    {
    case QEvent::ActionChanged:
        if (action == _action)
            setAction(action); // update button state
        break;
    case QEvent::ActionRemoved:
        if (_action == action)
            _action = 0;
        action->disconnect(this);
        break;
    default:
        ;
    }
    QWidget::actionEvent(event);
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:19,代码来源:menubutton.cpp

示例12: loadScene

void Scene1001::postInit(SceneObjectList *OwnerList) {
	loadScene(16);
	Scene::postInit();
	setZoomPercents(0, 100, 200, 100);

	_stripManager.addSpeaker(&_speakerQText);
	_stripManager.addSpeaker(&_speakerCText);
	_stripManager.addSpeaker(&_speakerCR);
	_stripManager.addSpeaker(&_speakerSL);
	_speakerQText._color1 = 11;

	_object3.postInit();
	_object3.setVisage(16);
	_object3.setStrip2(4);
	_object3.setPosition(Common::Point(61, 177));

	_globals->_soundHandler.play(85);
	setAction(&_action1);
}
开发者ID:TomFrost,项目名称:scummvm,代码行数:19,代码来源:ringworld_scenes2.cpp

示例13: UndoGlobalQuantityData

void CreateNewGlobalQuantityCommand::redo()
{
  if (mpGlobalQuantityData == NULL)
    {
      // TODO: this is again needs to happen only once
      mpModelValue->createNewGlobalQuantity();
      std::string sName = mpModelValue->mpModelValue->getObjectName();
      mpGlobalQuantityData = new UndoGlobalQuantityData(mpModelValue->mpModelValue);
      setName(sName);
    }
  else
    {
      mpModelValue->addGlobalQuantity(mpGlobalQuantityData);
    }

  setUndoState(true);
  setAction("Create");

}
开发者ID:jonasfoe,项目名称:COPASI,代码行数:19,代码来源:CreateNewGlobalQuantityCommand.cpp

示例14: UndoSpeciesData

void CreateNewSpeciesCommand::redo()
{
  if (mpSpeciesData == NULL)
    {
      // TODO: should only happen once
      mpSpeciesDetail->createNewSpecies();
      std::string sName = mpSpeciesDetail->mpMetab->getObjectName();
      mpSpeciesData = new UndoSpeciesData(mpSpeciesDetail->mpMetab);
      setName(sName);
    }
  else
    {
      mpSpeciesDetail->addSpecies(mpSpeciesData);
    }

  setUndoState(true);
  setAction("Create");

}
开发者ID:jonasfoe,项目名称:COPASI,代码行数:19,代码来源:CreateNewSpeciesCommand.cpp

示例15: QWidget

UASActionsWidget::UASActionsWidget(QWidget *parent) : QWidget(parent)
{
    QLOG_INFO() << "UASActionsWidget creating " << this;
    m_uas = NULL;
    ui.setupUi(this);
    connect(ui.changeAltitudeButton,SIGNAL(clicked()),this,SLOT(changeAltitudeClicked()));
    connect(ui.changeSpeedButton,SIGNAL(clicked()),this,SLOT(changeSpeedClicked()));
    connect(ui.goToWaypointButton,SIGNAL(clicked()),this,SLOT(goToWaypointClicked()));
    connect(ui.armDisarmButton,SIGNAL(clicked()),this,SLOT(armButtonClicked()));
    connect(UASManager::instance(),SIGNAL(activeUASSet(UASInterface*)),this,SLOT(activeUASSet(UASInterface*)));

    if (UASManager::instance()->getActiveUAS())
    {
        activeUASSet(UASManager::instance()->getActiveUAS());
    }

    ui.missionGroupBox->setDisabled(true);
    ui.actionsGroupBox->setDisabled(true);
    ui.shortcutGroupBox->setDisabled(true);

    connect(ui.exeActionButton, SIGNAL(clicked()),
            this, SLOT(setAction()));

    // Mode Shortcut Buttons
    connect(ui.autoModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.stabilizeModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.rtlModeButton, SIGNAL(clicked()),
            this, SLOT(setRTLMode()));
    connect(ui.loiterModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));

    connect(ui.opt1ModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.opt2ModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.opt3ModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.opt4ModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
}
开发者ID:WorkerBees,项目名称:apm_planner,代码行数:42,代码来源:UASActionsWidget.cpp


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