world添加获取tick值方法

This commit is contained in:
xzb 2023-08-15 09:17:22 +08:00
parent 3c3dd9f408
commit 102081251c

View File

@ -45,6 +45,7 @@ type World interface {
SetSpeed(speed float64) error SetSpeed(speed float64) error
AddSystem(sys ...ISystem) AddSystem(sys ...ISystem)
Close() Close()
Tick() int
} }
type world struct { 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 { func (w *world) Id() WorldId {
return WorldId(w.world.Id()) return WorldId(w.world.Id())
} }