本文整理汇总了C++中UObject::GetExtension方法的典型用法代码示例。如果您正苦于以下问题:C++ UObject::GetExtension方法的具体用法?C++ UObject::GetExtension怎么用?C++ UObject::GetExtension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UObject
的用法示例。
在下文中一共展示了UObject::GetExtension方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseScene
/**
* @inheritDoc
*/
void DefinitionService::parseScene(std::string sScene) {
const auto& scenes = m_gdProto.scenes();
auto sceneIt = std::find(scenes.begin(), scenes.end(), sScene);
if (sceneIt == scenes.end()) {
return;
}
SystemService* systemService = IServiceManager::get()->getSystemService();
//
// Create the initial scene for each system.
//
for (auto it : systemService->get()) {
m_pScene->Extend(it.second);
}
//
// Parse the SDF file
//
Proto::Scene scene;
Error result = loadProto(*sceneIt + ".sdf.bin", &scene);
ASSERT(result == Errors::Success);
//
// Initialize the scene templates.
//
m_pScene->addTemplates(&scene.templates());
//
// Initialize the System scenes.
//
for (auto system : scene.systems()) {
m_pSystem = systemService->get(system.type());
ASSERTMSG1(m_pSystem != NULL, "Parser was unable to get system %s.", Proto::SystemType_Name(system.type()));
if (m_pSystem != NULL) {
auto it = m_pScene->GetSystemScenes().find(m_pSystem->GetSystemType());
ASSERTMSG1(it != m_pScene->GetSystemScenes().end(), "Parser was unable to find a scene for system %s.", Proto::SystemType_Name(system.type()));
m_pSystemScene = it->second;
ASSERT(m_pSystemScene != NULL);
// Initialize system scene properties
m_pSystemScene->setProperties(system.properties());
m_pSystemScene->initialize();
}
}
//
// Initialize the scene objects.
//
for (auto object : scene.objects()) {
m_pScene->createObject(&object);
}
//
// Refresh all scenes
//
for (auto scene : m_pScene->GetSystemScenes()) {
scene.second->GlobalSceneStatusChanged(ISystemScene::PostLoadingObjects);
}
//
// Initialize the links.
//
for (auto link : scene.links()) {
UObject* pSubject = m_pScene->FindObject(link.subject().c_str());
UObject* pObserver = m_pScene->FindObject(link.observer().c_str());
//
// Get the extension for the object.
//
ISystemObject* pSystemObserver = pSystemObserver = pObserver->GetExtension(link.observersystemtype());
//
// Call the scene to register the links.
//
if (link.subjectsystemtype() != Proto::SystemType::Null) {
ISystemObject* pSystemSubject = pSystemSubject = pSubject->GetExtension(link.subjectsystemtype());
m_pScene->CreateObjectLink(pSystemSubject, pSystemObserver);
} else {
m_pScene->CreateObjectLink(pSubject, pSystemObserver);
}
}
}