本文整理汇总了C++中ComponentPtr::GetInterfaces方法的典型用法代码示例。如果您正苦于以下问题:C++ ComponentPtr::GetInterfaces方法的具体用法?C++ ComponentPtr::GetInterfaces怎么用?C++ ComponentPtr::GetInterfaces使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ComponentPtr
的用法示例。
在下文中一共展示了ComponentPtr::GetInterfaces方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessComponent
void ElementGroup::ProcessComponent(const ComponentPtr& component, bool removable)
{
bool added = AddInspector(component, component->GetType(), removable);
// If there wasn't a specific inspector for the given type, try adding interface inspectors
if (!added)
{
// Make sure the transform inspector is at the top
const auto& actualInterfaces = component->GetInterfaces();
auto entry = actualInterfaces.find("ITransform");
if (entry == actualInterfaces.end())
{
for (auto it = actualInterfaces.begin(), end = actualInterfaces.end(); it != end; ++it)
added |= AddInspector(component, *it, removable);
}
else
{
AddInspector(component, "ITransform", false);
std::set<std::string> interfacesMinusTransform = actualInterfaces;
interfacesMinusTransform.erase("ITransform");
for (auto it = interfacesMinusTransform.begin(), end = interfacesMinusTransform.end(); it != end; ++it)
added |= AddInspector(component, *it, removable);
}
}
if (!added)
SendToConsole("No inspector for component type: " + component->GetType());
}