[cpp] Added Skin::removeAttachment.

This commit is contained in:
badlogic 2019-07-25 15:21:19 +02:00
parent 3f412f1f4d
commit 3e84da4d63
2 changed files with 7 additions and 0 deletions

View File

@ -119,6 +119,9 @@ public:
/// If the name already exists for the slot, the previous value is replaced.
void addAttachment(size_t slotIndex, const String &name, Attachment *attachment);
// Removes the attachment from the skin.
void removeAttachment(size_t slotIndex, const String& name);
/// Returns the attachment for the specified slot index and name, or NULL.
Attachment *getAttachment(size_t slotIndex, const String &name);

View File

@ -95,6 +95,10 @@ void Skin::addAttachment(size_t slotIndex, const String &name, Attachment *attac
_attachments.put(slotIndex, name, attachment);
}
void Skin::removeAttachment(size_t slotIndex, const String& name) {
_attachments.remove(slotIndex, name);
}
Attachment *Skin::getAttachment(size_t slotIndex, const String &name) {
return _attachments.get(slotIndex, name);
}