Пример #1
0
	void ResourceManager::addResource(IResourcePtr _item)
	{
		if (!_item->getResourceName().empty())
			mResources[_item->getResourceName()] = _item;
		if (!_item->getResourceID().empty())
			mResourcesID[_item->getResourceID()] = _item;
	}
Пример #2
0
	void ResourceManager::removeResource(IResourcePtr _item)
	{
		if (_item == nullptr) return;

		if (!_item->getResourceName().empty())
		{
			MapResource::iterator item = mResources.find(_item->getResourceName());
			if (item != mResources.end())
				mResources.erase(item);
		}

		if (!_item->getResourceID().empty())
		{
			MapResourceID::iterator id = mResourcesID.find(_item->getResourceID());
			if (id != mResourcesID.end())
				mResourcesID.erase(id);
		}
	}