27 lines
523 B
Go
27 lines
523 B
Go
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()
|
|
}
|