add GUIObjectState::remove_property()

This commit is contained in:
Paul Davis 2020-02-06 14:39:07 -07:00
parent a13fabf344
commit c791d5970f
2 changed files with 11 additions and 0 deletions

View File

@ -157,3 +157,13 @@ GUIObjectState::all_ids () const
}
return ids;
}
void
GUIObjectState::remove_property (const string & id, const string & prop_name)
{
std::map <std::string, XMLNode*>::iterator i = object_map.find (id);
if (i == object_map.end()) {
return;
}
i->second->remove_property (prop_name);
}

View File

@ -50,6 +50,7 @@ public:
XMLNode* child = get_or_add_node (id);
child->set_property (prop_name.c_str(), val);
}
void remove_property (const std::string & id, const std:: string & prop_name);
/** Remove node with provided id.
* @param id property of Object node to look for.