本文整理汇总了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
}
}
示例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
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
}
}
}
示例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));
}
示例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);
}
示例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);
}
示例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];
}
示例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);
}
}
示例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;
}