Remove removes the specified INode from the list of children. Returns true if found or false otherwise.
(ichild INode)
| 415 | // Remove removes the specified INode from the list of children. |
| 416 | // Returns true if found or false otherwise. |
| 417 | func (n *Node) Remove(ichild INode) bool { |
| 418 | |
| 419 | for pos, current := range n.children { |
| 420 | if current == ichild { |
| 421 | copy(n.children[pos:], n.children[pos+1:]) |
| 422 | n.children[len(n.children)-1] = nil |
| 423 | n.children = n.children[:len(n.children)-1] |
| 424 | ichild.GetNode().parent = nil |
| 425 | n.Dispatch(OnDescendant, nil) |
| 426 | return true |
| 427 | } |
| 428 | } |
| 429 | return false |
| 430 | } |
| 431 | |
| 432 | // RemoveAt removes the child at the specified index. |
| 433 | func (n *Node) RemoveAt(idx int) INode { |