本文整理汇总了C++中CExtension::ExecuteGlobals方法的典型用法代码示例。如果您正苦于以下问题:C++ CExtension::ExecuteGlobals方法的具体用法?C++ CExtension::ExecuteGlobals怎么用?C++ CExtension::ExecuteGlobals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CExtension
的用法示例。
在下文中一共展示了CExtension::ExecuteGlobals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BindDesign
ALERROR CDesignCollection::BindDesign (const TArray<CExtension *> &BindOrder, bool bNewGame, bool bNoResources, CString *retsError)
// BindDesign
//
// Binds the design collection to the set of design types in the given list of
// extensions.
{
DEBUG_TRY
ALERROR error;
int i;
// Unbind everything
DEBUG_TRY
CShipClass::UnbindGlobal();
for (i = 0; i < m_AllTypes.GetCount(); i++)
m_AllTypes.GetEntry(i)->UnbindDesign();
m_AllTypes.DeleteAll();
DEBUG_CATCH_MSG("Crash unbinding types.");
// Reset the bind tables
for (i = 0; i < designCount; i++)
m_ByType[i].DeleteAll();
m_CreatedTypes.DeleteAll(true);
m_OverrideTypes.DeleteAll();
// Reset
m_pTopology = NULL;
m_pAdventureExtension = NULL;
// Create a design load context
SDesignLoadCtx Ctx;
Ctx.bBindAsNewGame = bNewGame;
Ctx.bNoResources = bNoResources;
// Loop over the bind list in order and add appropriate types to m_AllTypes
// (The order guarantees that the proper types override)
for (i = 0; i < BindOrder.GetCount(); i++)
{
CExtension *pExtension = BindOrder[i];
try {
const CDesignTable &Types = pExtension->GetDesignTypes();
#ifdef DEBUG_BIND
::OutputDebugString(strPatternSubst(CONSTLIT("EXTENSION %s\n"), pExtension->GetName()));
for (int j = 0; j < Types.GetCount(); j++)
{
::OutputDebugString(strPatternSubst(CONSTLIT("%08x: %s\n"), Types.GetEntry(j)->GetUNID(), Types.GetEntry(j)->GetTypeName()));
}
#endif
// Run globals for the extension
if (error = pExtension->ExecuteGlobals(Ctx))
{
*retsError = Ctx.sError;
return error;
}
// Add the types
m_AllTypes.Merge(Types, &m_OverrideTypes);
// If this is the adventure, then remember it
if (pExtension->GetType() == extAdventure)
{
m_pAdventureExtension = pExtension;
m_pAdventureDesc = pExtension->GetAdventureDesc();
}
// If this is an adventure or the base extension then take the
// topology.
if (pExtension->GetType() == extAdventure || pExtension->GetType() == extBase)
m_pTopology = &pExtension->GetTopology();
} catch (...)
{
::kernelDebugLogMessage("Crash processing extension:");
CExtension::DebugDump(pExtension, true);
throw;
}
}
// If this is a new game, then create all the Template types
if (bNewGame)
//.........这里部分代码省略.........