當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。