jl-ecs/debug/debug.go

27 lines
523 B
Go
Raw Normal View History

package debug
import (
"bytes"
"github.com/yohamta/donburi"
"github.com/yohamta/donburi/features/debug"
)
type EntityCounts = debug.EntityCounts
func GetEntityCounts(w donburi.World) []EntityCounts {
return debug.GetEntityCounts(w)
}
// 打印所有实体数量
func SPrintEntityCounts(w donburi.World) string {
var out bytes.Buffer
out.WriteString("Entity Counts:\n")
for _, c := range GetEntityCounts(w) {
out.WriteString(c.String())
out.WriteString("\n")
}
out.WriteString("\n")
return out.String()
}