world添加获取tick值方法

This commit is contained in:
xzb 2023-08-15 09:17:22 +08:00
parent 3c3dd9f408
commit 102081251c
1 changed files with 4 additions and 0 deletions

View File

@ -45,6 +45,7 @@ type World interface {
SetSpeed(speed float64) error
AddSystem(sys ...ISystem)
Close()
Tick() int
}
type world struct {
@ -73,6 +74,9 @@ func NewWorld(tick int) World {
}
}
func (w *world) Tick() int {
return w.tick
}
func (w *world) Id() WorldId {
return WorldId(w.world.Id())
}