当前位置: 首页>>代码示例>>C++>>正文


C++ CComponentManager::InitSystemEntity方法代码示例

本文整理汇总了C++中CComponentManager::InitSystemEntity方法的典型用法代码示例。如果您正苦于以下问题:C++ CComponentManager::InitSystemEntity方法的具体用法?C++ CComponentManager::InitSystemEntity怎么用?C++ CComponentManager::InitSystemEntity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CComponentManager的用法示例。


在下文中一共展示了CComponentManager::InitSystemEntity方法的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);
			}
		
		}
	}
开发者ID:,项目名称:,代码行数:54,代码来源:

示例2: ResetComponentState

	static void ResetComponentState(CComponentManager& componentManager, bool skipScriptedComponents, bool skipAI)
	{
		componentManager.ResetState();
		componentManager.InitSystemEntity();
		componentManager.AddSystemComponents(skipScriptedComponents, skipAI);
	}
开发者ID:JoshuaBelden,项目名称:0ad,代码行数:6,代码来源:Simulation2.cpp


注:本文中的CComponentManager::InitSystemEntity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。