2023-10-09 14:21:24 +08:00
|
|
|
package debug
|
|
|
|
|
|
|
|
import (
|
2023-10-10 18:26:51 +08:00
|
|
|
"bytes"
|
|
|
|
|
|
|
|
"github.com/yohamta/donburi"
|
2023-10-09 14:21:24 +08:00
|
|
|
"github.com/yohamta/donburi/features/debug"
|
|
|
|
)
|
|
|
|
|
2023-10-10 18:26:51 +08:00
|
|
|
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()
|
2023-10-09 14:21:24 +08:00
|
|
|
}
|