16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 17:09:19 +02:00
This commit is contained in:
milek7
2019-01-14 22:45:22 +01:00
parent b2a9388fab
commit f55a5465ef
30 changed files with 172 additions and 214 deletions

12
Names.h
View File

@@ -41,6 +41,18 @@ public:
{
return insert(Item, Item->name());
}
void purge (std::string const &Name)
{
auto lookup = m_itemmap.find( Name );
if (lookup == m_itemmap.end())
return;
delete m_items[lookup->second];
m_items[lookup->second] = nullptr;
// TBD, TODO: remove from m_items?
m_itemmap.erase(lookup);
}
// locates item with specified name. returns pointer to the item, or nullptr
Type_ *
find( std::string const &Name ) const {