本文整理汇总了C++中Entity::GetFamily方法的典型用法代码示例。如果您正苦于以下问题:C++ Entity::GetFamily方法的具体用法?C++ Entity::GetFamily怎么用?C++ Entity::GetFamily使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entity
的用法示例。
在下文中一共展示了Entity::GetFamily方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FlushChangeFamily
void EntityManager::FlushChangeFamily()
{
Map<Entity*, EntityFamilyType>::iterator it = newFamilyEntities.begin();
Map<Entity*, EntityFamilyType>::iterator itEnd = newFamilyEntities.end();
for(; it != itEnd; ++it)
{
Entity * entity = it->first;
ProcessAddRemoveComponent(entity, entity->GetFamily(), it->second);
entity->changeState = 0;
}
newFamilyEntities.clear();
}
示例2: FlushDestroy
void EntityManager::FlushDestroy()
{
int32 size = deleteEntities.size();
for(int32 i = 0; i < size; ++i)
{
Entity * entity = deleteEntities[i];
Map<uint64, EntityFamily*>::iterator it = families.find(entity->GetFamily().GetBit());
if(it != families.end())
{
EntityFamily * family = it->second;
family->DeleteEntity(entity);
RemoveFromGlobalList(entity);
delete(entity);
}
else
{
//entity with no family
}
}
deleteEntities.clear();
}