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


C++ FAssert函数代码示例

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


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

示例1: GET_PLAYER

//------------------------------------------------------------------------------
void CvDllNetMessageHandler::ResponseChangeWar(PlayerTypes ePlayer, TeamTypes eRivalTeam, bool bWar)
{
	CvPlayerAI& kPlayer = GET_PLAYER(ePlayer);
	CvTeam& kTeam = GET_TEAM(kPlayer.getTeam());
	const TeamTypes eTeam = kPlayer.getTeam();

	FAssert(eTeam != eRivalTeam);

	if(bWar)
	{
#if defined(MOD_EVENTS_WAR_AND_PEACE)
		kTeam.declareWar(eRivalTeam, false, ePlayer);
#else
		kTeam.declareWar(eRivalTeam);
#endif
	}
	else
	{
#if defined(MOD_EVENTS_WAR_AND_PEACE)
		kTeam.makePeace(eRivalTeam, true, false, ePlayer);
#else
		kTeam.makePeace(eRivalTeam);
#endif
	}
}
开发者ID:QuinaryLogician,项目名称:DLL-VMC,代码行数:26,代码来源:CvDllNetMessageHandler.cpp

示例2: FAssert

//------------------------------------------------------------------------------
void CvDllGameContext::InitializeSingleton()
{
	if(s_pSingleton == NULL)
	{
		FAssert(s_hHeap == INVALID_HANDLE_VALUE);
		s_hHeap = HeapCreate(0, 0, 0);

		//
		// Enable the low-fragmentation heap (LFH). Starting with Windows Vista,
		// the LFH is enabled by default but this call does not cause an error.
		//
		ULONG HeapInformation = 2;	//Low Fragmentation Heap
		HeapSetInformation(s_hHeap,
		                   HeapCompatibilityInformation,
		                   &HeapInformation,
		                   sizeof(HeapInformation));

	}
	s_pSingleton = FNEW(CvDllGameContext(), c_eCiv5GameplayDLL, 0);

#if defined(CUSTOM_MODS_H)
	CUSTOMLOG("%s - Startup (Version %u%s - Build %s %s%s)", MOD_DLL_NAME, MOD_DLL_VERSION_NUMBER, MOD_DLL_VERSION_STATUS, __DATE__, __TIME__, MOD_DLL_CUSTOM_BUILD_NAME);
#if defined(MOD_GLOBAL_MAX_MAJOR_CIVS)
	CUSTOMLOG(" - supporting %i major civilizations", MAX_MAJOR_CIVS);
#endif
#endif
}
开发者ID:qqqbbb,项目名称:Community-Patch-DLL,代码行数:28,代码来源:CvDllContext.cpp

示例3: FAssertMsg

void CvArea::setBestFoundValue(PlayerTypes eIndex, int iNewValue)
{
	FAssertMsg(eIndex >= 0, "eIndex is expected to be >= 0");
	FAssertMsg(eIndex < MAX_PLAYERS, "eIndex is expected to be < MAX_PLAYERS");
	m_aiBestFoundValue[eIndex] = iNewValue;
	FAssert(getBestFoundValue(eIndex) >= 0);
}
开发者ID:mastrude,项目名称:Medieval_Tech,代码行数:7,代码来源:CvArea.cpp

示例4: FAssert

//	---------------------------------------------------------------------------
/// New Goody Hut Result from a Player
void CvGoodyHuts::DoPlayerReceivedGoody(PlayerTypes ePlayer, GoodyTypes eGoody)
{
	FAssert(ePlayer >= 0);
	FAssert(ePlayer < MAX_MAJOR_CIVS);
	FAssert(eGoody >= 0);
	//	FAssert(eGoody < DB.count("GoodyHuts"));

	// Push elements up in the array so that we free up element 0
	for (int iGoodySlotLoop = 0; iGoodySlotLoop < NUM_GOODIES_REMEMBERED-1; iGoodySlotLoop++)
	{
		m_aaiPlayerGoodyHutResults[ePlayer][iGoodySlotLoop+1] = m_aaiPlayerGoodyHutResults[ePlayer][iGoodySlotLoop];
	}

	// Most recent Goody gets slot 0
	m_aaiPlayerGoodyHutResults[ePlayer][0] = eGoody;
}
开发者ID:Be1eriand,项目名称:Civ5-DLL,代码行数:18,代码来源:CvGoodyHuts.cpp

示例5: PROFILE_FUNC

// Returns attack odds out of 100 (the higher, the better...)
int CvSelectionGroupAI::AI_attackOdds(const CvPlot* pPlot, bool bPotentialEnemy) const
{
	PROFILE_FUNC();

	CvUnit* pAttacker;

	FAssert(getOwnerINLINE() != NO_PLAYER);

/************************************************************************************************/
/* BETTER_BTS_AI_MOD                      02/21/10                                jdog5000      */
/*                                                                                              */
/* Efficiency, Lead From Behind                                                                 */
/************************************************************************************************/
	// From Lead From Behind by UncutDragon
	// original
	//if (pPlot->getBestDefender(NO_PLAYER, getOwnerINLINE(), NULL, !bPotentialEnemy, bPotentialEnemy) == NULL)
	// modified
	if (!pPlot->hasDefender(false, NO_PLAYER, getOwnerINLINE(), NULL, !bPotentialEnemy, bPotentialEnemy))
/************************************************************************************************/
/* BETTER_BTS_AI_MOD                       END                                                  */
/************************************************************************************************/
	{
		return 100;
	}

	int iOdds = 0;
	pAttacker = AI_getBestGroupAttacker(pPlot, bPotentialEnemy, iOdds);

	if (pAttacker == NULL)
	{
		return 0;
	}

	return iOdds;
}
开发者ID:Ungomma,项目名称:Civ4-K-Mod,代码行数:36,代码来源:CvSelectionGroupAI.cpp

示例6: FAssertMsg

void CvArea::changePopulationPerPlayer(PlayerTypes eIndex, int iChange)
{
	FAssertMsg(eIndex >= 0, "eIndex is expected to be >= 0");
	FAssertMsg(eIndex < MAX_PLAYERS, "eIndex is expected to be < MAX_PLAYERS");
	m_aiPopulationPerPlayer[eIndex] += iChange;
	FAssert(getPopulationPerPlayer(eIndex) >= 0);
}
开发者ID:Nightinggale,项目名称:Religion_and_Revolution_Extended,代码行数:7,代码来源:CvArea.cpp

示例7: Visit

static void Visit(FObject key, FObject val, FObject ctx)
{
    FAssert(GlobalP(val));

    if (AsGlobal(val)->State == GlobalUndefined)
        UndefinedList = MakePair(AsGlobal(val)->Name, UndefinedList);
}
开发者ID:beimprovised,项目名称:foment,代码行数:7,代码来源:library.cpp

示例8: ListLength

int_t ListLength(FObject lst)
{
    int_t ll = 0;
    FObject fst = lst;
    FObject slw = lst;

    for (;;)
    {
        if (fst == EmptyListObject)
            break;

        if (PairP(fst) == 0)
            return(-1);

        fst = Rest(fst);
        ll += 1;

        if (fst == EmptyListObject)
            break;

        if (PairP(fst) == 0 || fst == slw)
            return(-1);

        fst = Rest(fst);
        ll += 1;

        FAssert(PairP(slw));
        slw = Rest(slw);

        if (fst == slw)
            return(-1);
    }

    return(ll);
}
开发者ID:beimprovised,项目名称:foment,代码行数:35,代码来源:pairs.cpp

示例9: PROFILE

void CvMapGenerator::addFeatures()
{
	PROFILE("CvMapGenerator::addFeatures");

	if (gDLL->getPythonIFace()->callFunction(gDLL->getPythonIFace()->getMapScriptModule(), "addFeatures", NULL))
	{
		if (!gDLL->getPythonIFace()->pythonUsingDefaultImpl())
		{
			return;
		}
	}

	for (int iI = 0; iI < GC.getMapINLINE().numPlotsINLINE(); iI++)
	{
		CvPlot* pPlot = GC.getMapINLINE().plotByIndexINLINE(iI);
		FAssert(pPlot != NULL);

		for (int iJ = 0; iJ < GC.getNumFeatureInfos(); iJ++)
		{
			if (pPlot->canHaveFeature((FeatureTypes)iJ))
			{
				if (GC.getGameINLINE().getMapRandNum(10000, "addFeaturesAtPlot") < GC.getFeatureInfo((FeatureTypes)iJ).getAppearanceProbability())
				{
					pPlot->setFeatureType((FeatureTypes)iJ);
				}
			}
		}
	}
}
开发者ID:RichterBelmont,项目名称:BadgameBTSMod,代码行数:29,代码来源:CvMapGenerator.cpp

示例10: ResolvedGet

static FObject ResolvedGet(FObject env, FObject symid)
{
    FAssert(IdentifierP(symid) || SymbolP(symid));

    if (IdentifierP(symid))
    {
        while (IdentifierP(AsIdentifier(symid)->Wrapped))
        {
            env = AsSyntacticEnv(AsIdentifier(symid)->SyntacticEnv)->GlobalBindings;
            symid = AsIdentifier(symid)->Wrapped;
        }
    }

    FAssert(EnvironmentP(env));

    return(EnvironmentGet(env, symid));
}
开发者ID:beimprovised,项目名称:foment,代码行数:17,代码来源:library.cpp

示例11: EnvironmentImportSet

void EnvironmentImportSet(FObject env, FObject is, FObject form)
{
    FObject ilst = DoImportSet(env, is, form);

    while (PairP(ilst))
    {
        FAssert(GlobalP(First(ilst)));

        if (EnvironmentImportGlobal(env, First(ilst)))
            RaiseExceptionC(R.Syntax, "import", "expected an undefined identifier",
                    List(AsGlobal(First(ilst))->Name, form));

        ilst = Rest(ilst);
    }

    FAssert(ilst == EmptyListObject);
}
开发者ID:beimprovised,项目名称:foment,代码行数:17,代码来源:library.cpp

示例12: EnvironmentGet

FObject EnvironmentGet(FObject env, FObject symid)
{
    if (IdentifierP(symid))
        symid = AsIdentifier(symid)->Symbol;

    FAssert(SymbolP(symid));

    FObject gl = EqHashMapRef(AsEnvironment(env)->HashMap, symid, FalseObject);
    if (GlobalP(gl))
    {
        FAssert(BoxP(AsGlobal(gl)->Box));

        return(Unbox(AsGlobal(gl)->Box));
    }

    return(NoValueObject);
}
开发者ID:beimprovised,项目名称:foment,代码行数:17,代码来源:library.cpp

示例13: FAssert

// 
// Player record accessor
//
CvPlayerRecord *CvStatistics::getPlayerRecord(int iIndex)
{
	FAssert(iIndex >= 0);
	FAssert(iIndex < MAX_PLAYERS);

	if ( iIndex >= (int)m_PlayerRecords.size() || m_PlayerRecords[iIndex] == NULL )
	{
		CvPlayerRecord *pRecord = new CvPlayerRecord;

		pRecord->init();
		pRecord->setPlayerID( iIndex );
		m_PlayerRecords.resize(iIndex + 1, NULL);
		m_PlayerRecords[iIndex] = pRecord;
	}

	return m_PlayerRecords[iIndex];
}
开发者ID:Alrik2002,项目名称:Civ4-MMod,代码行数:20,代码来源:CvStatistics.cpp

示例14: 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,代码来源:CvMessageData.cpp

示例15: FAssert

/// Get a specific entry
CvNotificationEntry *CvNotificationXMLEntries::GetEntry(int index)
{
    FAssert(index < static_cast<int>(m_paNotificationEntries.size()));

    if(index < static_cast<int>(m_paNotificationEntries.size()))
	    return m_paNotificationEntries[index];
    return NULL;
}
开发者ID:Be1eriand,项目名称:Civ5-DLL,代码行数:9,代码来源:CvNotificationClasses.cpp


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