| 285 | } |
| 286 | |
| 287 | void Spine::setSlot(String name, Node* item) { |
| 288 | AssertIf(_flags.isOn(Node::Cleanup), "can not operate on an invalid Spine"); |
| 289 | if (!_slots) { |
| 290 | _slots = New<StringMap<Ref<Node>>>(); |
| 291 | } |
| 292 | auto it = _slots->find(name); |
| 293 | if (it != _slots->end()) { |
| 294 | it->second->removeFromParent(); |
| 295 | _slots->erase(it); |
| 296 | } |
| 297 | if (item) { |
| 298 | (*_slots)[name.toString()] = item; |
| 299 | item->setVisible(false); |
| 300 | addChild(item); |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | Node* Spine::getSlot(String name) { |
| 305 | AssertIf(_flags.isOn(Node::Cleanup), "can not operate on an invalid Spine"); |
nothing calls this directly
no test coverage detected