16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 18:19:19 +02:00

node delete in editor

This commit is contained in:
milek7
2019-02-23 15:35:23 +01:00
parent cbb61ce639
commit 37dc56a8d8
2 changed files with 28 additions and 2 deletions

10
Names.h
View File

@@ -62,6 +62,16 @@ public:
m_itemmap.erase(lookup);
}
void purge (Type_ *Item)
{
for (auto it = m_items.begin(); it != m_items.end(); it++) {
if (*it == Item) {
delete *it;
*it = nullptr;
return;
}
}
}
// locates item with specified name. returns pointer to the item, or nullptr
Type_ *
find( std::string const &Name ) const {