MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / setSlot

Method setSlot

Source/Node/Spine.cpp:287–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285}
286
287void 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
304Node* Spine::getSlot(String name) {
305 AssertIf(_flags.isOn(Node::Cleanup), "can not operate on an invalid Spine");

Callers

nothing calls this directly

Calls 8

addChildFunction · 0.85
isOnMethod · 0.80
removeFromParentMethod · 0.80
findMethod · 0.65
toStringMethod · 0.65
endMethod · 0.45
eraseMethod · 0.45
setVisibleMethod · 0.45

Tested by

no test coverage detected