您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GET_TEAM函数代码示例

51自学网 2021-06-01 20:51:59
  C++
这篇教程C++ GET_TEAM函数代码示例写得很实用,希望能帮到您。

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

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

示例1: GET_PLAYER

/// Guess as to how much another Player is prioritizing the SS as his means of winning the gameint CvGrandStrategyAI::GetGuessOtherPlayerSpaceshipPriority(PlayerTypes ePlayer, int iWorldNumTechsAverage){	VictoryTypes eVictory = (VictoryTypes) GC.getInfoTypeForString("VICTORY_SPACE_RACE", true);	// If SS Victory isn't even available then don't bother with anything	if(eVictory == NO_VICTORY)	{		return -100;	}	TeamTypes eTeam = GET_PLAYER(ePlayer).getTeam();	// If the player has the Apollo Program we're pretty sure he's going for the SS	ProjectTypes eApolloProgram = (ProjectTypes) GC.getInfoTypeForString("PROJECT_APOLLO_PROGRAM", true);	if(eApolloProgram != NO_PROJECT)	{		if(GET_TEAM(eTeam).getProjectCount(eApolloProgram) > 0)		{			return /*150*/ GC.getAI_GS_SS_HAS_APOLLO_PROGRAM();		}	}	int iNumTechs = GET_TEAM(eTeam).GetTeamTechs()->GetNumTechsKnown();	// Don't divide by zero, okay?	if(iWorldNumTechsAverage == 0)		iWorldNumTechsAverage = 1;	int iSSPriority = (iNumTechs - iWorldNumTechsAverage) * /*300*/ GC.getAI_GS_SS_TECH_PROGRESS_MOD() / iWorldNumTechsAverage;	return iSSPriority;}
开发者ID:Jheral,项目名称:Civ5Comps,代码行数:33,


示例2: GET_PLAYER

//------------------------------------------------------------------------------void CvDllNetMessageHandler::ResponseResearch(PlayerTypes ePlayer, TechTypes eTech, int iDiscover, PlayerTypes ePlayerToStealFrom, bool bShift){	CvPlayerAI& kPlayer = GET_PLAYER(ePlayer);	CvTeam& kTeam = GET_TEAM(kPlayer.getTeam());	// Free tech	if(iDiscover > 0)	{		// Make sure we can research this tech for free		if(kPlayer.GetPlayerTechs()->CanResearchForFree(eTech))		{			kTeam.setHasTech(eTech, true, ePlayer, true, true);			if(iDiscover > 1)			{				if(ePlayer == GC.getGame().getActivePlayer())				{					kPlayer.chooseTech(iDiscover - 1);				}			}			kPlayer.SetNumFreeTechs(max(0, iDiscover - 1));		}	}	// Stealing tech	else if(ePlayerToStealFrom != NO_PLAYER)	{		// make sure we can still take a tech		CvAssertMsg(kPlayer.GetEspionage()->m_aiNumTechsToStealList[ePlayerToStealFrom] > 0, "No techs to steal from player");		CvAssertMsg(kPlayer.GetEspionage()->m_aaPlayerStealableTechList[ePlayerToStealFrom].size() > 0, "No techs to be stolen from this player");		CvAssertMsg(kPlayer.GetPlayerTechs()->CanResearch(eTech), "Player can't research this technology");		CvAssertMsg(GET_TEAM(GET_PLAYER(ePlayerToStealFrom).getTeam()).GetTeamTechs()->HasTech(eTech), "ePlayerToStealFrom does not have the requested tech");		if (kPlayer.GetEspionage()->m_aiNumTechsToStealList[ePlayerToStealFrom] > 0)		{			kTeam.setHasTech(eTech, true, ePlayer, true, true);			kPlayer.GetEspionage()->m_aiNumTechsToStealList[ePlayerToStealFrom]--;		}	}	// Normal tech	else	{		CvPlayerTechs* pPlayerTechs = kPlayer.GetPlayerTechs();		CvTeamTechs* pTeamTechs = kTeam.GetTeamTechs();		if(eTech == NO_TECH)		{			kPlayer.clearResearchQueue();		}		else if(pPlayerTechs->CanEverResearch(eTech))		{			if((pTeamTechs->HasTech(eTech) || pPlayerTechs->IsResearchingTech(eTech)) && !bShift)			{				kPlayer.clearResearchQueue();			}			kPlayer.pushResearch(eTech, !bShift);		}	}}
开发者ID:DivineYuri,项目名称:Community-Patch-DLL,代码行数:59,


示例3: atWar

bool atWar(TeamTypes eTeamA, TeamTypes eTeamB){	if((eTeamA == NO_TEAM) || (eTeamB == NO_TEAM))	{		return false;	}	CvAssert(GET_TEAM(eTeamA).isAtWar(eTeamB) == GET_TEAM(eTeamB).isAtWar(eTeamA));	CvAssert((eTeamA != eTeamB) || !(GET_TEAM(eTeamA).isAtWar(eTeamB)));	return GET_TEAM(eTeamA).isAtWar(eTeamB);}
开发者ID:Ninakoru,项目名称:Community-Patch-DLL,代码行数:12,


示例4: GET_TEAM

// Calculate how much we owe this turn due to taxesvoid CvTreasury::CalculateExpensePerTurnFromVassalTaxes(){	TeamTypes eMaster = GET_TEAM(m_pPlayer->getTeam()).GetMaster();	if(eMaster == NO_TEAM) {		if(GetExpensePerTurnFromVassalTaxes() != 0)			SetExpensePerTurnFromVassalTaxesTimes100(0);		return;	}	int iNet = CalculateGrossGoldTimes100();	int iTax = iNet * GET_TEAM(eMaster).GetVassalTax(m_pPlayer->GetID()) / 100;	SetExpensePerTurnFromVassalTaxesTimes100(iTax);}
开发者ID:J-d-H,项目名称:Community-Patch-DLL,代码行数:14,


示例5: defined

/// Should this player be ignored when creating the danger plots?bool CvDangerPlots::ShouldIgnorePlayer(PlayerTypes ePlayer){	//if one is major and the other a minor (but no barbarian)	if(GET_PLAYER(m_ePlayer).isMinorCiv() != GET_PLAYER(ePlayer).isMinorCiv() && !GET_PLAYER(ePlayer).isBarbarian() && !GET_PLAYER(m_ePlayer).isBarbarian())	{		CvPlayer* pMinor = NULL;		CvPlayer* pMajor;		if(GET_PLAYER(m_ePlayer).isMinorCiv())		{			pMinor = &GET_PLAYER(m_ePlayer);			pMajor = &GET_PLAYER(ePlayer);		}		else		{			pMinor = &GET_PLAYER(ePlayer);			pMajor = &GET_PLAYER(m_ePlayer);		}		if(pMinor->GetMinorCivAI()->IsFriends(pMajor->GetID()))		{			return true;		}		// if we're a major, we should ignore minors that are not at war with us		if (!GET_PLAYER(m_ePlayer).isMinorCiv())		{			TeamTypes eMajorTeam = pMajor->getTeam();			TeamTypes eMinorTeam = pMinor->getTeam();			if (!GET_TEAM(eMajorTeam).isAtWar(eMinorTeam))			{				return true;			}		}	}#if defined(MOD_DIPLOMACY_CIV4_FEATURES)	//ignore if one is vassal of the other	if ( GET_TEAM(GET_PLAYER(m_ePlayer).getTeam()).IsVassal(GET_PLAYER(ePlayer).getTeam()) ||		 GET_TEAM(GET_PLAYER(ePlayer).getTeam()).IsVassal(GET_PLAYER(m_ePlayer).getTeam()) )		 return true;#endif#if defined(MOD_BALANCE_CORE_MILITARY)	//ignore if at peace	if ( !GET_TEAM(GET_PLAYER(m_ePlayer).getTeam()).isAtWar(GET_PLAYER(ePlayer).getTeam()) )		 return true;#endif	return false;}
开发者ID:JFDaly,项目名称:Community-Patch-DLL,代码行数:52,


示例6: AI_launch

void CvPlayerAI::AI_launch(VictoryTypes eVictory){	if(GET_TEAM(getTeam()).isHuman())	{		return;	}	if(!GET_TEAM(getTeam()).canLaunch(eVictory))	{		return;	}	launch(eVictory);}
开发者ID:GrantSP,项目名称:Civ5-DLL,代码行数:14,


示例7: AlexanderConquest

//------------------------------------------------------------------------------void CvAchievementUnlocker::AlexanderConquest(PlayerTypes ePlayer){	//Test For Alexander Conquest	CvGame& kGame = GC.getGame();	if (ePlayer == kGame.getActivePlayer())	{		CvString szLeaderName = (CvString)GET_PLAYER(ePlayer).getLeaderTypeKey();		if(szLeaderName == "LEADER_ALEXANDER")		{			if(kGame.getGameTurnYear() <= 350)			{				for(int iPlayerLoop = 0; iPlayerLoop < MAX_PLAYERS; iPlayerLoop++)				{					CvPlayer* pPlayer = &GET_PLAYER((PlayerTypes) iPlayerLoop);					//All known players must be dead and killed by us					if(GET_TEAM(pPlayer->getTeam()).isHasMet(GET_PLAYER(kGame.getActivePlayer()).getTeam()))					{						if(!pPlayer->isBarbarian() && !pPlayer->isMinorCiv())						{							if(pPlayer->isAlive() && pPlayer->GetID() != GET_PLAYER(kGame.getActivePlayer()).GetID())							{								return;	// Nope.							}						}					}				}				// Yep.				gDLL->UnlockAchievement(ACHIEVEMENT_SPECIAL_CONQUEST_WORLD);			}		}	}}
开发者ID:Be1eriand,项目名称:Civ5-DLL,代码行数:34,


示例8: GET_PLAYER

// What are our gold maintenance costs because of Vassals?int CvTreasury::GetVassalGoldMaintenance() const{	int iRtnValue = 0;	// We have a vassal	for(int iI = 0; iI < MAX_MAJOR_CIVS; iI++)	{		if(!GET_PLAYER((PlayerTypes)iI).isMinorCiv()			&& !GET_PLAYER((PlayerTypes)iI).isBarbarian()			&& GET_PLAYER((PlayerTypes)iI).isAlive())		{			int iLoop, iCityPop;			// This player is our vassal			if(GET_TEAM(GET_PLAYER((PlayerTypes)iI).getTeam()).IsVassal(m_pPlayer->getTeam()))			{				// Loop through our vassal's cities				for(CvCity* pLoopCity = GET_PLAYER((PlayerTypes)iI).firstCity(&iLoop); pLoopCity != NULL; pLoopCity = GET_PLAYER((PlayerTypes)iI).nextCity(&iLoop))				{					iCityPop = pLoopCity->getPopulation();					iRtnValue += std::max(0, (int)(pow((double)iCityPop, (double)/*0.6*/ GC.getVASSALAGE_VASSAL_CITY_POP_EXPONENT())));				}				iRtnValue += std::max(0, (GET_PLAYER((PlayerTypes)iI).GetTreasury()->GetExpensePerTurnUnitMaintenance() * /*10*/GC.getVASSALAGE_VASSAL_UNIT_MAINT_COST_PERCENT() / 100));			}		}	}	// Modifier for vassal maintenance?	iRtnValue *= (100 + m_pPlayer->GetVassalGoldMaintenanceMod());	iRtnValue /= 100;	return iRtnValue;}
开发者ID:J-d-H,项目名称:Community-Patch-DLL,代码行数:33,


示例9: GET_PLAYER

// Find all our enemies (combat units)void CvTacticalAnalysisMap::BuildEnemyUnitList(){	m_EnemyUnits.clear();	m_EnemyCities.clear();	TeamTypes ourTeam = GET_PLAYER(m_ePlayer).getTeam();	for(int iPlayer = 0; iPlayer < MAX_PLAYERS; iPlayer++)	{		const PlayerTypes ePlayer = (PlayerTypes)iPlayer;		CvPlayer& kPlayer = GET_PLAYER(ePlayer);		const TeamTypes eTeam = kPlayer.getTeam();		// for each opposing civ		if(kPlayer.isAlive() && GET_TEAM(eTeam).isAtWar(ourTeam))		{			int iLoop;			CvUnit* pLoopUnit = NULL;			CvCity* pLoopCity;			for(pLoopCity = kPlayer.firstCity(&iLoop); pLoopCity != NULL; pLoopCity = kPlayer.nextCity(&iLoop))				if (pLoopCity->plot()->isRevealed(ourTeam))					m_EnemyCities.push_back(pLoopCity->GetIDInfo());			for(pLoopUnit = kPlayer.firstUnit(&iLoop); pLoopUnit != NULL; pLoopUnit = kPlayer.nextUnit(&iLoop))				if(pLoopUnit->IsCanAttack() && pLoopUnit->plot()->isVisible(ourTeam))					m_EnemyUnits.push_back(pLoopUnit->GetIDInfo());		}	}}
开发者ID:kawyua,项目名称:Community-Patch-DLL,代码行数:30,


示例10: GetSpaceshipPriority

/// Returns Priority for Spaceship Grand Strategyint CvGrandStrategyAI::GetSpaceshipPriority(){	int iPriority = 0;	// If SS Victory isn't even available then don't bother with anything	VictoryTypes eVictory = (VictoryTypes) GC.getInfoTypeForString("VICTORY_SPACE_RACE", true);	if(eVictory == NO_VICTORY || !GC.getGame().isVictoryValid(eVictory))	{		return -100;	}	int iFlavorScience =  m_pPlayer->GetFlavorManager()->GetPersonalityIndividualFlavor((FlavorTypes)GC.getInfoTypeForString("FLAVOR_SCIENCE"));	// the later the game the greater the chance	iPriority += m_pPlayer->GetCurrentEra() * iFlavorScience * 150 / 100;	// if I already built the Apollo Program I am very likely to follow through	ProjectTypes eApolloProgram = (ProjectTypes) GC.getInfoTypeForString("PROJECT_APOLLO_PROGRAM", true);	if(eApolloProgram != NO_PROJECT)	{		if(GET_TEAM(m_pPlayer->getTeam()).getProjectCount(eApolloProgram) > 0)		{			iPriority += /*150*/ GC.getAI_GS_SS_HAS_APOLLO_PROGRAM();		}	}	return iPriority;}
开发者ID:Jheral,项目名称:Civ5Comps,代码行数:29,


示例11: switch

void CvGameObjectUnit::foreach(GameObjectTypes eType, boost::function<void (CvGameObject*)> func){    switch(eType)    {    case GAMEOBJECT_GAME:        func(GC.getGameINLINE().getGameObject());        break;    case GAMEOBJECT_TEAM:        func(GET_TEAM(m_pUnit->getTeam()).getGameObject());        break;    case GAMEOBJECT_PLAYER:        func(GET_PLAYER(m_pUnit->getOwnerINLINE()).getGameObject());        break;    case GAMEOBJECT_CITY:        m_pUnit->plot()->getGameObject()->foreach(eType, func);        break;    case GAMEOBJECT_PLOT:        func(m_pUnit->plot()->getGameObject());        break;    case GAMEOBJECT_UNIT:        func(this);        break;    }}
开发者ID:gdambrauskas,项目名称:anewdawn1.74Hspinoff,代码行数:29,


示例12: GET_PLAYER

// Find all our enemies (combat units)void CvTacticalAnalysisMap::BuildEnemyUnitList(){	CvTacticalAnalysisEnemy enemy;	m_EnemyUnits.clear();	for(int iPlayer = 0; iPlayer < MAX_PLAYERS; iPlayer++)	{		const PlayerTypes ePlayer = (PlayerTypes)iPlayer;		CvPlayer& kPlayer = GET_PLAYER(ePlayer);		const TeamTypes eTeam = kPlayer.getTeam();		// for each opposing civ		if(kPlayer.isAlive() && GET_TEAM(eTeam).isAtWar(m_pPlayer->getTeam()))		{			int iLoop;			CvUnit* pLoopUnit = NULL;			for(pLoopUnit = kPlayer.firstUnit(&iLoop); pLoopUnit != NULL; pLoopUnit = kPlayer.nextUnit(&iLoop))			{				// Make sure this unit can attack				if(pLoopUnit->IsCanAttack())				{					m_EnemyUnits.push_back(pLoopUnit);				}			}		}	}}
开发者ID:QuinaryLogician,项目名称:DLL-VMC,代码行数:28,


示例13: FAssert

void CvNetChangeVassal::Execute(){	if (m_ePlayer != NO_PLAYER)	{		FAssert(GET_PLAYER(m_ePlayer).getTeam() != m_eMasterTeam);		GET_TEAM(GET_PLAYER(m_ePlayer).getTeam()).setVassal(m_eMasterTeam, m_bVassal, m_bCapitulated);	}}
开发者ID:markourm,项目名称:fall,代码行数:8,


示例14: GetTeamClosenessScore

//	--------------------------------------------------------------------------------// For each of n teams, let the closeness score for that team be the average distance of an edge between two players on that team.// This function calculates the closeness score for each team and returns the sum of those n scores.// The lower the result, the better "clumped" the players' starting locations are.//// Note: for the purposes of this function, player i will be assumed to start in the location of player aiStartingLocs[i]int CvGameQueries::GetTeamClosenessScore(int** aaiDistances, int* aiStartingLocs){	int iScore = 0;	for(int iTeam = 0; iTeam < MAX_CIV_TEAMS; iTeam++)	{		if(GET_TEAM((TeamTypes)iTeam).isAlive())		{			int iTeamTotalDist = 0;			int iNumEdges = 0;			for(int iPlayer = 0; iPlayer < MAX_CIV_PLAYERS; iPlayer++)			{				if(GET_PLAYER((PlayerTypes)iPlayer).isAlive())				{					if(GET_PLAYER((PlayerTypes)iPlayer).getTeam() == (TeamTypes)iTeam)					{						for(int iOtherPlayer = 0; iOtherPlayer < iPlayer; iOtherPlayer++)						{							if(GET_PLAYER((PlayerTypes)iOtherPlayer).getTeam() == (TeamTypes)iTeam)							{								// Add the edge between these two players that are on the same team								iNumEdges++;								int iPlayerStart = aiStartingLocs[iPlayer];								int iOtherPlayerStart = aiStartingLocs[iOtherPlayer];								if(iPlayerStart < iOtherPlayerStart)  // Make sure that iPlayerStart > iOtherPlayerStart								{									int iTemp = iPlayerStart;									iPlayerStart = iOtherPlayerStart;									iOtherPlayerStart = iTemp;								}								else if(iPlayerStart == iOtherPlayerStart)								{									CvAssertMsg(false, "Two players are (hypothetically) assigned to the same starting location!");								}								iTeamTotalDist += aaiDistances[iPlayerStart][iOtherPlayerStart];							}						}					}				}			}			int iTeamScore;			if(iNumEdges == 0)			{				iTeamScore = 0;			}			else			{				iTeamScore = iTeamTotalDist/iNumEdges; // the avg distance between team edges is the team score			}			iScore += iTeamScore;		}	}	return iScore;}
开发者ID:Be1eriand,项目名称:Civ5-DLL,代码行数:63,


示例15: CvAssertMsg

CvPlot* CvPlayerAI::FindBestMerchantTargetPlot(CvUnit* pGreatMerchant, bool bOnlySafePaths){	CvAssertMsg(pGreatMerchant, "pGreatMerchant is null");	if(!pGreatMerchant)	{		return NULL;	}	int iBestTurnsToReach = MAX_INT;	CvPlot* pBestTargetPlot = NULL;	int iPathTurns;	UnitHandle pMerchant = UnitHandle(pGreatMerchant);	CvTeam& kTeam = GET_TEAM(getTeam());	// Loop through each city state	for(int iI = 0; iI < MAX_PLAYERS; iI++)	{		CvPlayer& kPlayer = GET_PLAYER((PlayerTypes)iI);		if(kPlayer.isMinorCiv())		{			CvPlot* pCSPlot = kPlayer.getStartingPlot();			if(pCSPlot)			{				if(pCSPlot->isRevealed(getTeam()))				{					// Is this a minor we are friendly with?					if(GetDiplomacyAI()->GetMinorCivApproach(kPlayer.GetID()) != MINOR_CIV_APPROACH_CONQUEST &&					        !kTeam.isAtWar(kPlayer.getTeam()) && GetDiplomacyAI()->GetWarGoal(kPlayer.GetID()) == NO_WAR_GOAL_TYPE)					{						// Search all the plots adjacent to this city (since can't enter the minor city plot itself)						for(int jJ = 0; jJ < NUM_DIRECTION_TYPES; jJ++)						{							CvPlot* pAdjacentPlot = plotDirection(pCSPlot->getX(), pCSPlot->getY(), ((DirectionTypes)jJ));							if(pAdjacentPlot != NULL)							{								// Make sure this is still owned by the city state and is revealed to us and isn't a water tile								if(pAdjacentPlot->getOwner() == (PlayerTypes)iI && pAdjacentPlot->isRevealed(getTeam())								        && !pAdjacentPlot->isWater())								{									iPathTurns = TurnsToReachTarget(pMerchant, pAdjacentPlot, true /*bReusePaths*/, !bOnlySafePaths/*bIgnoreUnits*/);									if(iPathTurns < iBestTurnsToReach)									{										iBestTurnsToReach = iPathTurns;										pBestTargetPlot = pAdjacentPlot;									}								}							}						}					}				}			}		}	}	return pBestTargetPlot;}
开发者ID:Be1eriand,项目名称:Civ5-DLL,代码行数:56,


示例16: PUF_canDeclareWar

bool PUF_canDeclareWar(const CvUnit* pUnit, int iData1, int iData2){	CvAssertMsg(iData1 != -1, "Invalid data argument, should be >= 0");	CvAssertMsg(iData2 != -1, "Invalid data argument, should be >= 0");	TeamTypes eOtherTeam = GET_PLAYER((PlayerTypes)iData1).getTeam();	TeamTypes eOurTeam = GET_PLAYER(pUnit->getCombatOwner(eOtherTeam, *(pUnit->plot()))).getTeam();	if(pUnit->canCoexistWithEnemyUnit(eOtherTeam))	{		return false;	}#if defined(MOD_EVENTS_WAR_AND_PEACE)	return (iData2 ? false : GET_TEAM(eOtherTeam).canDeclareWar(eOurTeam, (PlayerTypes)iData1));#else	return (iData2 ? false : GET_TEAM(eOtherTeam).canDeclareWar(eOurTeam));#endif}
开发者ID:Ninakoru,项目名称:Community-Patch-DLL,代码行数:19,


示例17: Execute

void CvNetPing::Execute(){	if (GC.getGameINLINE().getActiveTeam() != NO_TEAM)	{		if (GET_PLAYER(m_ePlayer).getTeam() == GC.getGameINLINE().getActiveTeam() || GET_TEAM(GC.getGameINLINE().getActiveTeam()).isVassal(GET_PLAYER(m_ePlayer).getTeam()) || GET_TEAM(GET_PLAYER(m_ePlayer).getTeam()).isVassal(GC.getGameINLINE().getActiveTeam()))		{			gDLL->getInterfaceIFace()->doPing(m_iX, m_iY, m_ePlayer);		}	}}
开发者ID:markourm,项目名称:fall,代码行数:10,


示例18: GET_PLAYER

void CvGameAI::AI_updateAssignWork(){	int iI;	for (iI = 0; iI < MAX_PLAYERS; iI++)	{		CvPlayer& kLoopPlayer = GET_PLAYER((PlayerTypes)iI);		if (GET_TEAM(kLoopPlayer.getTeam()).isHuman() && kLoopPlayer.isAlive())		{			kLoopPlayer.AI_updateAssignWork();		}	}}
开发者ID:DarkLunaPhantom,项目名称:civ4ffplus,代码行数:13,


示例19: GET_PLAYER

void CvNetResearch::Execute(){	if (m_ePlayer != NO_PLAYER)	{		CvPlayer& kPlayer = GET_PLAYER(m_ePlayer);		if (m_iDiscover > 0)		{			GET_TEAM(kPlayer.getTeam()).setHasTech(m_eTech, true, m_ePlayer, true, true);			if (m_iDiscover > 1)			{				if (m_ePlayer == GC.getGameINLINE().getActivePlayer())				{					kPlayer.chooseTech(m_iDiscover - 1);				}			}		}		else		{			if (m_eTech == NO_TECH)			{				kPlayer.clearResearchQueue();			}			else if (kPlayer.canEverResearch(m_eTech))			{				if ((GET_TEAM(kPlayer.getTeam()).isHasTech(m_eTech) || kPlayer.isResearchingTech(m_eTech)) && !m_bShift)				{					kPlayer.clearResearchQueue();				}				kPlayer.pushResearch(m_eTech, !m_bShift);			}		}		if (GC.getGameINLINE().getActivePlayer() == m_ePlayer)		{			gDLL->getInterfaceIFace()->updatePythonScreens();		}	}}
开发者ID:markourm,项目名称:fall,代码行数:39,


示例20: GET_PLAYER

/// Guess as to how much another Player is prioritizing the UN as his means of winning the gameint CvGrandStrategyAI::GetGuessOtherPlayerUnitedNationsPriority(PlayerTypes ePlayer){	VictoryTypes eVictory = (VictoryTypes) GC.getInfoTypeForString("VICTORY_DIPLOMATIC", true);	// If UN Victory isn't even available then don't bother with anything	if(eVictory == NO_VICTORY)	{		return -100;	}	TeamTypes eTeam = GET_PLAYER(ePlayer).getTeam();	int iVotesNeededToWin = GC.getGame().GetVotesNeededForDiploVictory();	int iSecuredVotes = 0;	// Loop through Players to see if they'll vote for this player	PlayerTypes eLoopPlayer;	TeamTypes eLoopTeam;	for(int iPlayerLoop = 0; iPlayerLoop < MAX_CIV_PLAYERS; iPlayerLoop++)	{		eLoopPlayer = (PlayerTypes) iPlayerLoop;		if(GET_PLAYER(eLoopPlayer).isAlive())		{			eLoopTeam = GET_PLAYER(eLoopPlayer).getTeam();			// Liberated?			if(GET_TEAM(eLoopTeam).GetLiberatedByTeam() == eTeam)			{				iSecuredVotes++;			}			// Minor civ?			else if(GET_PLAYER(eLoopPlayer).isMinorCiv())			{				// Best Relations?				if(GET_PLAYER(eLoopPlayer).GetMinorCivAI()->GetAlly() == ePlayer)				{					iSecuredVotes++;				}			}		}	}	int iUNPriority = iSecuredVotes* /*300*/ GC.getAI_GS_UN_SECURED_VOTE_MOD();	iUNPriority /= iVotesNeededToWin;	return iUNPriority;}
开发者ID:Decker87,项目名称:civ5DllMod,代码行数:51,


示例21: FAssert

// Returns ratio of strengths of stacks times 100// (so 100 is even ratio, numbers over 100 mean this group is more powerful than the stack on a plot)int CvSelectionGroupAI::AI_compareStacks(const CvPlot* pPlot, bool bCheckCanAttack) const{	FAssert(pPlot != NULL);	int	compareRatio;	DomainTypes eDomainType = getDomainType();	// if not aircraft, then choose based on the plot, not the head unit (mainly for transport carried units)	if (eDomainType != DOMAIN_AIR)	{		if (pPlot->isWater())			eDomainType = DOMAIN_SEA;		else			eDomainType = DOMAIN_LAND;	}	compareRatio = AI_sumStrength(pPlot, eDomainType, bCheckCanAttack);	compareRatio *= 100;	PlayerTypes eOwner = getOwnerINLINE();	if (eOwner == NO_PLAYER)	{		eOwner = getHeadOwner();	}	FAssert(eOwner != NO_PLAYER);		// K-Mod. Note. This function currently does not support bPotentialEnemy == false.	//FAssert(bPotentialEnemy);	int defenderSum = pPlot->isVisible(getHeadTeam(), false)		? GET_PLAYER(eOwner).AI_localDefenceStrength(pPlot, NO_TEAM, eDomainType, 0)		: GET_TEAM(getHeadTeam()).AI_getStrengthMemory(pPlot);	// K-Mod end	compareRatio /= std::max(1, defenderSum);	// K-Mod. If there are more defenders than we have attacks, but yet the ratio is still greater than 100,	// then inflate the ratio futher to account for the fact that we are going to do significantly more damage to them than they to us.	// The purpose of this is to give the AI extra encouragement to attack when its units are better than the defender's units.	/* if (compareRatio > 100)	{		FAssert(getHeadUnit() && getNumUnits() > 0);		int iDefenders = pPlot->getNumVisibleEnemyDefenders(getHeadUnit());		if (iDefenders > getNumUnits())		{			compareRatio += (compareRatio - 100) * (iDefenders - getNumUnits()) / getNumUnits();		}	} */ // (currently disabled)	// K-Mod end	return compareRatio;}
开发者ID:Ungomma,项目名称:Civ4-K-Mod,代码行数:52,


示例22: getCyTeam

CyTeam* CyGlobalContext::getCyTeam(int i){	static CyTeam cyTeams[MAX_TEAMS];	static bool bInit=false;	if (!bInit)	{		int j;		for(j=0;j<MAX_TEAMS;j++)		{			cyTeams[j]=CyTeam(&GET_TEAM((TeamTypes)j));		}		bInit = true;	}	return i<MAX_TEAMS ? &cyTeams[i] : NULL;}
开发者ID:Nightinggale,项目名称:Medieval_Tech,代码行数:15,


示例23: team_winning

int		team_winning(t_user *usr, t_team *team){  t_user	*tmp;  tmp = usr;  while (tmp != NULL && tmp->prev != NULL)    tmp = tmp->prev;  while (tmp != NULL)    {      if (tmp->type == AI && GET_TEAM(tmp) == team && GET_LVL(tmp) == 8)	return (1);      tmp = tmp->next;    }  return (0);}
开发者ID:fave-r,项目名称:Zappy,代码行数:15,



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


C++ GET_THIS_VIRTUAL_RV函数代码示例
C++ GET_TC函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。