Add Visit method for dynbt.Compound

This commit is contained in:
Tnze
2024-05-20 23:21:33 +08:00
parent d63cc1de3f
commit 6de9cb7f15

View File

@ -220,3 +220,12 @@ type kv struct {
tag string
v *Value
}
func (c *Compound) Visit(f func(tag string, v *Value)) {
if c == nil {
return
}
for _, kv := range c.kvs {
f(kv.tag, kv.v)
}
}