Deleting Children: DeleteChildAt deletes child at the given index. It returns false if there is no child at the given index.
(index int)
| 336 | // DeleteChildAt deletes child at the given index. It returns false |
| 337 | // if there is no child at the given index. |
| 338 | func (n *NodeBase) DeleteChildAt(index int) bool { |
| 339 | child := n.Child(index) |
| 340 | if child == nil { |
| 341 | return false |
| 342 | } |
| 343 | n.Children = slices.Delete(n.Children, index, index+1) |
| 344 | child.Destroy() |
| 345 | return true |
| 346 | } |
| 347 | |
| 348 | // DeleteChild deletes the given child node, returning false if |
| 349 | // it can not find it. |
no test coverage detected