// [&] - how many and in what way will the lambda expression have access to the variables in surrounding scope, [] - no variables [&] - all variables by reference [=] - all variables by value
// (ScenePointer& p) - parameters passed to the function
// -> bool - return type
// function body encolsed in {}
assert(found!=mChildren.end());// We check validity of the iterator of the found element
ScenePointerresult=std::move(*found);// we move the found node out of the container to result
result->mParent=nullptr;// node's parent is set to null pointer
mChildren.erase(found);// we erase this element from the container
returnresult;// and we return the pointer to the node
child->update(deltaTime);// we also need to draw all the child nodes
}
}
voidSceneNode::update(sf::TimedeltaTime)
{
updateCurrent(deltaTime);
updateChildren(deltaTime);
}
sf::TransformSceneNode::getWorldTransform()const
{
sf::Transformtransform=sf::Transform::Identity;// sf::Transform::Identity represents the identity transform - it does not have any effecft on the object, it is not necessary in the code but it clarifies how transforms are applied