本文整理汇总了C++中CComponentManager::ResetState方法的典型用法代码示例。如果您正苦于以下问题:C++ CComponentManager::ResetState方法的具体用法?C++ CComponentManager::ResetState怎么用?C++ CComponentManager::ResetState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComponentManager
的用法示例。
在下文中一共展示了CComponentManager::ResetState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResetComponentState
static void ResetComponentState(CComponentManager& componentManager, bool skipScriptedComponents, bool skipAI)
{
componentManager.ResetState();
CParamNode noParam;
CComponentManager::ComponentTypeId cid;
componentManager.InitSystemEntity();
CEntityHandle systemEntity = componentManager.GetSystemEntity();
// Add native system components:
componentManager.AddComponent(systemEntity, CID_TemplateManager, noParam);
componentManager.AddComponent(systemEntity, CID_CommandQueue, noParam);
componentManager.AddComponent(systemEntity, CID_ObstructionManager, noParam);
componentManager.AddComponent(systemEntity, CID_ParticleManager, noParam);
componentManager.AddComponent(systemEntity, CID_Pathfinder, noParam);
componentManager.AddComponent(systemEntity, CID_ProjectileManager, noParam);
componentManager.AddComponent(systemEntity, CID_RangeManager, noParam);
componentManager.AddComponent(systemEntity, CID_SoundManager, noParam);
componentManager.AddComponent(systemEntity, CID_Terrain, noParam);
componentManager.AddComponent(systemEntity, CID_TerritoryManager, noParam);
componentManager.AddComponent(systemEntity, CID_WaterManager, noParam);
// Add scripted system components:
if (!skipScriptedComponents)
{
// TODO: Load this from a file to allow modders to add scripted components
// without having to recompile.
#define LOAD_SCRIPTED_COMPONENT(name) \
cid = componentManager.LookupCID(name); \
if (cid == CID__Invalid) \
LOGERROR(L"Can't find component type " L##name); \
componentManager.AddComponent(systemEntity, cid, noParam)
LOAD_SCRIPTED_COMPONENT("AIInterface");
LOAD_SCRIPTED_COMPONENT("AuraManager");
LOAD_SCRIPTED_COMPONENT("Barter");
LOAD_SCRIPTED_COMPONENT("EndGameManager");
LOAD_SCRIPTED_COMPONENT("GuiInterface");
LOAD_SCRIPTED_COMPONENT("PlayerManager");
LOAD_SCRIPTED_COMPONENT("TechnologyTemplateManager");
LOAD_SCRIPTED_COMPONENT("Timer");
LOAD_SCRIPTED_COMPONENT("ValueModificationManager");
#undef LOAD_SCRIPTED_COMPONENT
if (!skipAI)
{
componentManager.AddComponent(systemEntity, CID_AIManager, noParam);
}
}
}
示例2: ResetComponentState
static void ResetComponentState(CComponentManager& componentManager, bool skipScriptedComponents, bool skipAI)
{
componentManager.ResetState();
componentManager.InitSystemEntity();
componentManager.AddSystemComponents(skipScriptedComponents, skipAI);
}