コード例 #1
0
ファイル: ComponentManager.cpp プロジェクト: nahumfarchi/0ad
std::vector<int> CComponentManager::Script_GetEntitiesWithInterface(void* cbdata, int iid)
{
	CComponentManager* componentManager = static_cast<CComponentManager*> (cbdata);

	std::vector<int> ret;
	const InterfaceListUnordered& ents = componentManager->GetEntitiesWithInterfaceUnordered(iid);
	for (InterfaceListUnordered::const_iterator it = ents.begin(); it != ents.end(); ++it)
		ret.push_back(it->first); // TODO: maybe we should exclude local entities
	std::sort(ret.begin(), ret.end());
	return ret;
}
コード例 #2
0
std::vector<int> CComponentManager::Script_GetEntitiesWithInterface(ScriptInterface::CxPrivate* pCxPrivate, int iid)
{
	CComponentManager* componentManager = static_cast<CComponentManager*> (pCxPrivate->pCBData);

	std::vector<int> ret;
	const InterfaceListUnordered& ents = componentManager->GetEntitiesWithInterfaceUnordered(iid);
	for (InterfaceListUnordered::const_iterator it = ents.begin(); it != ents.end(); ++it)
		if (!ENTITY_IS_LOCAL(it->first))
			ret.push_back(it->first);
	std::sort(ret.begin(), ret.end());
	return ret;
}