这篇教程C++ FAssert函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中FAssert函数的典型用法代码示例。如果您正苦于以下问题:C++ FAssert函数的具体用法?C++ FAssert怎么用?C++ FAssert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了FAssert函数的23个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,
示例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,
示例3: FAssertMsgvoid 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,
示例4: FAssert// ---------------------------------------------------------------------------/// New Goody Hut Result from a Playervoid 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,
示例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,
示例6: FAssertMsgvoid 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,
示例7: Visitstatic 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,
示例8: ListLengthint_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,
示例9: PROFILEvoid 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,
示例10: ResolvedGetstatic 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,
示例11: EnvironmentImportSetvoid 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,
示例12: EnvironmentGetFObject 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,
示例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,
示例14: FAssertvoid 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,
示例15: FAssert/// Get a specific entryCvNotificationEntry *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,
示例16: CheckForRenamestatic FObject CheckForRename(FObject nam, FObject rlst){ FAssert(SymbolP(nam)); while (PairP(rlst)) { FObject rnm = First(rlst); FAssert(PairP(rnm)); FAssert(PairP(Rest(rnm))); if (SymbolP(First(rnm))) { FAssert(SymbolP(First(Rest(rnm)))); if (nam == First(rnm)) return(First(Rest(rnm))); } else { FAssert(IdentifierP(First(rnm))); FAssert(IdentifierP(First(Rest(rnm)))); if (nam == AsIdentifier(First(rnm))->Symbol) return(AsIdentifier(First(Rest(rnm)))->Symbol); } rlst = Rest(rlst); } FAssert(rlst == EmptyListObject); return(NoValueObject);}
开发者ID:beimprovised,项目名称:foment,代码行数:34,
示例17: FAssert// ---------------------------------------------------------------------------/// Have we gotten this type of Goody lately? (in the last 3 Goodies, defined by NUM_GOODIES_REMEMBERED)bool CvGoodyHuts::IsHasPlayerReceivedGoodyLately(PlayerTypes ePlayer, GoodyTypes eGoody){ FAssert(ePlayer >= 0); FAssert(ePlayer < MAX_MAJOR_CIVS); FAssert(eGoody >= 0); // FAssert(eGoody < DB.count("GoodyHuts")); // Look at all of our Goody slots and see if the requested Goody matches anything for (int iGoodySlotLoop = 0; iGoodySlotLoop < NUM_GOODIES_REMEMBERED; iGoodySlotLoop++) { if (m_aaiPlayerGoodyHutResults[ePlayer][iGoodySlotLoop] == eGoody) { return true; } } return false;}
开发者ID:gskleres,项目名称:nqmod-vs2008,代码行数:20,
示例18: GET_PLAYER//------------------------------------------------------------------------------void CvDllNetMessageHandler::ResponseIgnoreWarning(PlayerTypes ePlayer, TeamTypes eRivalTeam){ CvPlayerAI& kPlayer = GET_PLAYER(ePlayer); CvTeam& kTeam = GET_TEAM(kPlayer.getTeam()); const TeamTypes eTeam = kPlayer.getTeam(); FAssert(eTeam != eRivalTeam); kTeam.PushIgnoreWarning(eRivalTeam);}
开发者ID:DivineYuri,项目名称:Community-Patch-DLL,代码行数:10,
示例19: FAssert//------------------------------------------------------------------------------bool CvDllUnit::CanSwapWithUnitHere(ICvPlot1* pPlot) const{ CvPlot* pkPlot = (NULL != pPlot)? static_cast<CvDllPlot*>(pPlot)->GetInstance() : NULL; FAssert(pkPlot != NULL); if(pkPlot != NULL) return m_pUnit->CanSwapWithUnitHere(*pkPlot); else return false;}
开发者ID:Be1eriand,项目名称:Civ5-DLL,代码行数:10,
示例20: FAssert/// Changes the Priority Level the player has for a particular Grand Strategyvoid CvGrandStrategyAI::ChangeGrandStrategyPriority(AIGrandStrategyTypes eGrandStrategy, int iChange){ FAssert(eGrandStrategy != NO_AIGRANDSTRATEGY); if(iChange != 0) { m_paiGrandStrategyPriority[eGrandStrategy] += iChange; }}
开发者ID:Jheral,项目名称:Civ5Comps,代码行数:10,
示例21: FindLibrarystatic FObject FindLibrary(FObject nam){ FObject ll = R.LoadedLibraries; while (PairP(ll)) { FAssert(LibraryP(First(ll))); if (EqualP(AsLibrary(First(ll))->Name, nam)) return(First(ll)); ll = Rest(ll); } FAssert(ll == EmptyListObject); return(NoValueObject);}
开发者ID:beimprovised,项目名称:foment,代码行数:18,
示例22: EqualToSymbolstatic int_t EqualToSymbol(FObject obj, FObject sym){ FAssert(SymbolP(sym)); if (IdentifierP(obj)) return(AsIdentifier(obj)->Symbol == sym); return(obj == sym);}
开发者ID:beimprovised,项目名称:foment,代码行数:9,
示例23: VectorToListFObject VectorToList(FObject vec){ FAssert(VectorP(vec)); FObject lst = EmptyListObject; for (int_t idx = (int_t) VectorLength(vec) - 1; idx >= 0; idx--) lst = MakePair(AsVector(vec)->Vector[idx], lst); return(lst);}
开发者ID:beimprovised,项目名称:foment,代码行数:10,
注:本文中的FAssert函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ FAssertMsg函数代码示例 C++ FATFS_LinkDriver函数代码示例 |