Any way these manager classes are pretty much singletons with a map containing a name and a pointer to the location of each entity that the manager is dealing with.
Code: Select all
typedef std::map<std::string,Entity*> EntityMap; //the map's attribute types
EntityMap m_entities;
Heres one of my attempts, I had alot more but I think it would be pointless showing more of what doesn't work
Code: Select all
for(i = m_entities.end(); i != m_entities.begin(); --i)
{
delete i->second;
i = m_entities.erase(i);
}
P.S. another idea I had was a vector of pointers that point to the pointers. :P But I thought I would check here first to see if there was a better way then creating a whole other list of information that could be unnecassary.