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


C++ Ufo::getAlienRace方法代码示例

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


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

示例1: btnYesClick

/**
 * Enters the mission.
 * @param action Pointer to an action.
 */
void ConfirmLandingState::btnYesClick(Action *action)
{
	_game->popState();
	Ufo* u = dynamic_cast<Ufo*>(_craft->getDestination());
	TerrorSite* t = dynamic_cast<TerrorSite*>(_craft->getDestination());
	AlienBase* b = dynamic_cast<AlienBase*>(_craft->getDestination());
	if (u != 0)
	{
		SavedBattleGame *bgame = new SavedBattleGame();
		_game->getSavedGame()->setBattleGame(bgame);
		if(u->getStatus() == Ufo::CRASHED)
			bgame->setMissionType("STR_UFO_CRASH_RECOVERY");
		else
			bgame->setMissionType("STR_UFO_GROUND_ASSAULT");
		BattlescapeGenerator bgen = BattlescapeGenerator(_game);
		bgen.setWorldTexture(_texture);
		bgen.setWorldShade(_shade);
		bgen.setCraft(_craft);
		bgen.setUfo(u);
		bgen.setAlienRace(u->getAlienRace());
		bgen.setAlienItemlevel(0);
		bgen.run();

		_game->pushState(new BriefingState(_game, _craft));
	}
	else if (t != 0)
	{
		SavedBattleGame *bgame = new SavedBattleGame();
		_game->getSavedGame()->setBattleGame(bgame);
		bgame->setMissionType("STR_TERROR_MISSION");
		BattlescapeGenerator bgen = BattlescapeGenerator(_game);
		bgen.setWorldTexture(_texture);
		bgen.setWorldShade(_shade);
		bgen.setCraft(_craft);
		bgen.setTerrorSite(t);
		bgen.setAlienRace(t->getAlienRace());
		bgen.setAlienItemlevel(0);
		bgen.run();

		_game->pushState(new BriefingState(_game, _craft));
	}
	else if (b != 0)
	{
		SavedBattleGame *bgame = new SavedBattleGame();
		_game->getSavedGame()->setBattleGame(bgame);
		bgame->setMissionType("STR_ALIEN_BASE_ASSAULT");
		BattlescapeGenerator bgen = BattlescapeGenerator(_game);
		bgen.setWorldTexture(_texture);
		bgen.setWorldShade(_shade);
		bgen.setCraft(_craft);
		bgen.setAlienBase(b);
		bgen.setAlienRace(b->getAlienRace());
		bgen.setAlienItemlevel(0);
		bgen.run();

		_game->pushState(new BriefingState(_game, _craft));
	}
}
开发者ID:Tripphippie,项目名称:OpenXcom,代码行数:62,代码来源:ConfirmLandingState.cpp

示例2: btnYesClick

/**
 * Enters the mission.
 * @param action Pointer to an action.
 */
void ConfirmLandingState::btnYesClick(Action *)
{
	_game->popState();
	_state->musicStop();
	Ufo* u = dynamic_cast<Ufo*>(_craft->getDestination());
	TerrorSite* t = dynamic_cast<TerrorSite*>(_craft->getDestination());
	AlienBase* b = dynamic_cast<AlienBase*>(_craft->getDestination());
	size_t month = _game->getSavedGame()->getMonthsPassed();
	if (month > _game->getRuleset()->getAlienItemLevels().size()-1)
		month = _game->getRuleset()->getAlienItemLevels().size()-1;

	SavedBattleGame *bgame = new SavedBattleGame();
	_game->getSavedGame()->setBattleGame(bgame);
	BattlescapeGenerator bgen = BattlescapeGenerator(_game);
	bgen.setWorldTexture(_texture);
	bgen.setWorldShade(_shade);
	bgen.setCraft(_craft);
	if (u != 0)
	{
		if(u->getStatus() == Ufo::CRASHED)
			bgame->setMissionType("STR_UFO_CRASH_RECOVERY");
		else
			bgame->setMissionType("STR_UFO_GROUND_ASSAULT");
		bgen.setUfo(u);
		bgen.setAlienRace(u->getAlienRace());
	}
	else if (t != 0)
	{
		bgame->setMissionType("STR_TERROR_MISSION");
		bgen.setTerrorSite(t);
		bgen.setAlienRace(t->getAlienRace());
	}
	else if (b != 0)
	{
		bgame->setMissionType("STR_ALIEN_BASE_ASSAULT");
		bgen.setAlienBase(b);
		bgen.setAlienRace(b->getAlienRace());
	}
	else
	{
		throw Exception("No mission available!");
	}
	bgen.setAlienItemlevel(_game->getRuleset()->getAlienItemLevels().at(month).at(RNG::generate(0,9)));
	bgen.run();
	_game->pushState(new BriefingState(_game, _craft));
}
开发者ID:2xG,项目名称:OpenXcom,代码行数:50,代码来源:ConfirmLandingState.cpp

示例3: btnYesClick

/**
 * Enters the mission.
 * @param action Pointer to an action.
 */
void ConfirmLandingState::btnYesClick(Action *)
{
	_game->popState();
	Ufo* u = dynamic_cast<Ufo*>(_craft->getDestination());
	MissionSite* m = dynamic_cast<MissionSite*>(_craft->getDestination());
	AlienBase* b = dynamic_cast<AlienBase*>(_craft->getDestination());

	SavedBattleGame *bgame = new SavedBattleGame();
	_game->getSavedGame()->setBattleGame(bgame);
	BattlescapeGenerator bgen(_game);
	bgen.setWorldTexture(_texture);
	bgen.setWorldShade(_shade);
	bgen.setCraft(_craft);
	if (u != 0)
	{
		if (u->getStatus() == Ufo::CRASHED)
			bgame->setMissionType("STR_UFO_CRASH_RECOVERY");
		else
			bgame->setMissionType("STR_UFO_GROUND_ASSAULT");
		bgen.setUfo(u);
		bgen.setAlienRace(u->getAlienRace());
	}
	else if (m != 0)
	{
		bgame->setMissionType(m->getDeployment()->getType());
		bgen.setMissionSite(m);
		bgen.setAlienRace(m->getAlienRace());
	}
	else if (b != 0)
	{
		bgame->setMissionType(b->getDeployment()->getType());
		bgen.setAlienBase(b);
		bgen.setAlienRace(b->getAlienRace());
		bgen.setWorldTexture(0);
	}
	else
	{
		throw Exception("No mission available!");
	}
	bgen.run();
	_game->pushState(new BriefingState(_craft));
}
开发者ID:BHSDuncan,项目名称:OpenXcom,代码行数:46,代码来源:ConfirmLandingState.cpp


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