• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setAction函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: getNamePrefix

void InGameMenuWindow::createMenu(MenuBase* menu)
{
	CEGUI::WindowManager* windowMan = CEGUI::WindowManager::getSingletonPtr();

	const ActionVector actions = ActionManager::getSingleton().getInGameGlobalActions();
	map<CeGuiString, PopupMenu*> menuGroups;

	for (ActionVector::const_iterator actIter = actions.begin(); actIter != actions.end(); actIter++)
	{
        Action* action = *actIter;
		ActionGroup* group = action->getGroup();
		if (group != NULL)
		{
			PopupMenu* menuGrp;
			map<CeGuiString, PopupMenu*>::iterator grpIter = menuGroups.find(group->getName());
			if (grpIter != menuGroups.end())
			{
				menuGrp = (*grpIter).second;
			}
			else
			{
				MenuItem* grpItem = static_cast<MenuItem*>(windowMan->createWindow("RastullahLook/MenuItem",
					getNamePrefix()+"IngameMenu/"+group->getName()));
				grpItem->setText(group->getName());
				menu->addChildWindow(grpItem);

				menuGrp = static_cast<PopupMenu*>(windowMan->createWindow("RastullahLook/PopupMenu",
					getNamePrefix()+"IngameMenu/Menu"+group->getName()));
				grpItem->addChildWindow(menuGrp);

				menuGroups[group->getName()] = menuGrp;
			}

			MenuItem* item = static_cast<MenuItem*>(windowMan->createWindow("RastullahLook/MenuItem",
				getNamePrefix()+"IngameMenu/"+group->getName()+"/"+action->getName()));
			item->setText(action->getDescription());
			menuGrp->addChildWindow(item);

			setAction(item, action);
		}
	}
}
开发者ID:BackupTheBerlios,项目名称:dsa-hl-svn,代码行数:42,代码来源:InGameMenuWindow.cpp


示例17: setAction

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

	CStunnable::getTouchedBy(theObject);

	// Was it a bullet? Than make it stunned.
	if( dynamic_cast<CBullet*>(&theObject) )
	{
		setAction( rand()%2 ? A_SLUG_STUNNED : A_SLUG_STUNNED_ALT );
		dead = true;
		theObject.dead = true;
	}

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


示例18: moveLeft

void CMimrock::processBounce()
{
    if(xDirection == LEFT)
    {
	moveLeft(JUMP_SPEED);
    }
    else
    {
	moveRight(JUMP_SPEED);
    }
    
    if(mTimer>0)
	mTimer--;
    
    if(mTimer == 0 && blockedd)
    {
	mTimer = TIME_UNTIL_LOOK;
	setAction(A_MIMROCK_SIT);	
    }
}
开发者ID:FromCrimsonToWool,项目名称:Commander-Genius,代码行数:20,代码来源:CMimrock.cpp


示例19: initargs

static void initargs(int argc, char **argv)
{
    int c;

    CmdName = cmdName(argv[0]);
    opterr = 0;
    while ((c = getopt(argc, argv, ":gdo:")) != -1) {
	switch (c) {
	case 'd':
	    act = ToGV;
	    break;
	case 'g':
	    act = ToGXL;
	    break;
	case 'o':
	    outFile = openFile(optarg, "w");
	    break;
	case ':':
	    fprintf(stderr, "%s: option -%c missing argument\n", CmdName, optopt);
	    break;
	case '?':
	    if (optopt == '?')
		usage(0);
	    else {
		fprintf(stderr, "%s: option -%c unrecognized\n", CmdName,
			optopt);
		exit(1);
	    }
	}
    }

    argv += optind;
    argc -= optind;

    if (argc > 0)
	Files = argv;
    if (!outFile)
	outFile = stdout;
    if (act == Unset)
	setAction();
}
开发者ID:AhmedAMohamed,项目名称:graphviz,代码行数:41,代码来源:cvtgxl.c


示例20: setAction

void Monster::processAttack()
{
    if (!mTarget)
    {
        setAction(STAND);
        return;
    }

    if (!mCurrentAttack)
        return;

    mAttackTimeout.set(mCurrentAttack->aftDelay
                                 + mCurrentAttack->preDelay);

    float damageFactor = mCurrentAttack->damageFactor;

    Damage dmg;
    dmg.skill   = 0;
    dmg.base    = getModifiedAttribute(MOB_ATTR_PHY_ATK_MIN) * damageFactor;
    dmg.delta   = getModifiedAttribute(MOB_ATTR_PHY_ATK_DELTA) * damageFactor;
    dmg.cth     = getModifiedAttribute(ATTR_ACCURACY);
    dmg.element = mCurrentAttack->element;
    dmg.range   = mCurrentAttack->range;

    int hit = performAttack(mTarget, dmg);

    if (!mCurrentAttack->scriptEvent.empty() && hit > -1)
    {
        Script::Ref function = mSpecy->getEventCallback(mCurrentAttack->scriptEvent);
        if (function.isValid())
        {
            Script *script = ScriptManager::currentState();
            script->setMap(getMap());
            script->prepare(function);
            script->push(this);
            script->push(mTarget);
            script->push(hit);
            script->execute();
        }
    }
}
开发者ID:cubemoon,项目名称:manaserv,代码行数:41,代码来源:monster.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setActive函数代码示例发布时间:2022-05-30
下一篇:
C++ setAccessibleState函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap