unsigned GameObjectTagManager::unprojectTag( const Tag& tag, bool addIfDontExists ) const { if (const unsigned* index = StdMap::findValuePtr(tag2Index, tag)) return *index; if (!addIfDontExists) return InvalidIndex; unsigned newIndex = tag2Index[tag] = tag2Index.size(); if (newIndex >= MaxTagCount) throw std::exception("Tag count exceed max tag count"); taggedObjects.push_back(ObjectGroup()); index2Tag[newIndex] = tag; return newIndex; }
ObjectGroup& ObjectGroup::operator=(const ObjectGroup& o) { if(this==&o) return *this; ObjectGroup(o).swap(*this); return *this; }