mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
moved contains functions for multimap to Globals.h
This commit is contained in:
@@ -204,8 +204,8 @@ void CIdentifierStorage::registerObject(std::string scope, std::string type, std
|
||||
std::string fullID = type + '.' + name;
|
||||
checkIdentifier(fullID);
|
||||
|
||||
auto mapping = std::make_pair(fullID, data);
|
||||
if(!registeredObjects.contains(mapping))
|
||||
std::pair<const std::string, ObjectData> mapping = std::make_pair(fullID, data);
|
||||
if(!vstd::containsMapping(registeredObjects, mapping))
|
||||
{
|
||||
CLogger::getLogger(CLoggerDomain("identifier"))->traceStream() << "registered " << fullID << " as " << scope << ":" << identifier;
|
||||
registeredObjects.insert(mapping);
|
||||
|
||||
@@ -63,22 +63,7 @@ class CIdentifierStorage
|
||||
}
|
||||
};
|
||||
|
||||
class ObjectMap: public std::multimap<std::string, ObjectData>
|
||||
{
|
||||
public:
|
||||
bool contains(const value_type & value) const
|
||||
{
|
||||
auto range = equal_range(value.first);
|
||||
for(auto contained = range.first; contained != range.second; contained++)
|
||||
{
|
||||
if(value.second == contained->second)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
ObjectMap registeredObjects;
|
||||
std::multimap<std::string, ObjectData> registeredObjects;
|
||||
std::vector<ObjectCallback> scheduledRequests;
|
||||
|
||||
ELoadingState state;
|
||||
|
||||
Reference in New Issue
Block a user