(parentIndex int32, n Node, tgt *[]play.Node)
| 54 | } |
| 55 | |
| 56 | func appendNode(parentIndex int32, n Node, tgt *[]play.Node) { |
| 57 | index := int32(len(*tgt)) |
| 58 | (*tgt)[parentIndex].Children = append((*tgt)[parentIndex].Children, index) |
| 59 | (*tgt) = append((*tgt), n.Node) |
| 60 | |
| 61 | for _, child := range n.children { |
| 62 | appendNode(index, child, tgt) |
| 63 | } |
| 64 | } |